-
Notifications
You must be signed in to change notification settings - Fork 381
Expand file tree
/
Copy pathAccordionToggle.figma.tsx
More file actions
34 lines (31 loc) · 1.13 KB
/
AccordionToggle.figma.tsx
File metadata and controls
34 lines (31 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import figma from '@figma/code-connect';
import { AccordionItem, AccordionToggle, AccordionContent } from '@patternfly/react-core';
// Documentation for AccordionToggle can be found at https://www.patternfly.org/components/accordion
// Note: Adding on onClick event is recommended to initialize AccordionToggle
figma.connect(
AccordionToggle,
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1423-687',
{
props: {
// string
expandText: figma.string('Expand Text'),
// enum
open: figma.enum('State', { Expanded: true }),
toggleTextExpanded: figma.enum('State', {
Default: figma.string('Toggle Text'),
Hover: figma.string('Toggle Text'),
Expanded: figma.string('Toggle Text Expanded')
})
},
example: (props) => (
<AccordionItem isExpanded={props.open}>
<AccordionToggle onClick={() => {}} id="<your-id>">
{props.toggleTextExpanded}
</AccordionToggle>
<AccordionContent id="accordion-content-example">
<p>{props.expandText}</p>
</AccordionContent>
</AccordionItem>
)
}
);