1<Accordion
2 variant="splitted" // Using splitted to demonstrate item borders
3 accordionBackgroundColor="whitesmoke" // Background for the Accordion container
4 defaultTitleColor="darkslateblue" // Default color for all item titles
5 defaultSubtitleColor="slategray" // Default color for all item subtitles
6 defaultIndicatorColor="teal" // Default color for all item indicators
7 defaultItemBorderColor="mediumseagreen" // Border color for 'splitted' or 'bordered' items
8 // defaultDividerColor would apply if dividers were shown for this variant
9 style={{ paddingHorizontal: 8, marginVertical: 10 }} // Additional styles for Accordion container
10 itemClasses={{
11 // 'base' styles for splitted items are affected by defaultItemBorderColor
12 heading: { backgroundColor: '#e0f0e0', paddingVertical: 12 },
13 title: { fontWeight: '600' }, // itemClasses.title.color could override defaultTitleColor
14 subtitle: { fontStyle: 'italic' },
15 content: { paddingVertical: 12, backgroundColor: '#f0fff0' },
16 // divider: { backgroundColor: 'red' } // Customize divider if shown
17 }}
18>
19 <AccordionItem
20 itemKey="style1"
21 title="Item 1 with Custom Styling"
22 subtitle="Using global and class-based styles"
23 // 'style' prop on AccordionItem overrides itemClasses.base & defaultItemBorderColor for this specific item's border
24 style={{ shadowColor: 'black', shadowOffset: {width: 0, height: 1}, shadowOpacity: 0.2, shadowRadius: 2, elevation: 3 }}
25 >
26 This item inherits default colors, gets some styles from itemClasses, and has its own shadow via the 'style' prop.
27 </AccordionItem>
28 <AccordionItem itemKey="style2" title="Item 2 (Styled via Accordion Props)">
29 This item inherits styles from itemClasses.
30 </AccordionItem>
31</Accordion>