|
| 1 | +--- |
| 2 | +title: Accordion |
| 3 | +--- |
| 4 | + |
| 5 | +# Accordion |
| 6 | + |
| 7 | +## Accordion |
| 8 | + |
| 9 | + |
| 10 | +**Source:** [`packages/appkit-ui/src/react/ui/accordion.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/ui/accordion.tsx) |
| 11 | + |
| 12 | + |
| 13 | +### Props |
| 14 | + |
| 15 | +| Prop | Type | Required | Default | Description | |
| 16 | +|------|------|----------|---------|-------------| |
| 17 | +| `type` | `enum` | ✓ | - | - | |
| 18 | +| `value` | `string \| string[]` | | - | The controlled stateful value of the accordion item whose content is expanded. The controlled stateful value of the accordion items whose contents are expanded. | |
| 19 | +| `defaultValue` | `string \| string[]` | | - | The value of the item whose content is expanded when the accordion is initially rendered. Use `defaultValue` if you do not need to control the state of an accordion. The value of the items whose contents are expanded when the accordion is initially rendered. Use `defaultValue` if you do not need to control the state of an accordion. | |
| 20 | +| `onValueChange` | `((value: string) => void) \| ((value: string[]) => void)` | | - | The callback that fires when the state of the accordion changes. | |
| 21 | +| `collapsible` | `boolean` | | `false` | Whether an accordion item can be collapsed after it has been opened. | |
| 22 | +| `disabled` | `boolean` | | - | Whether or not an accordion is disabled from user interaction. @defaultValue false | |
| 23 | +| `orientation` | `enum` | | `vertical` | The layout in which the Accordion operates. | |
| 24 | +| `dir` | `enum` | | - | The language read direction. | |
| 25 | +| `asChild` | `boolean` | | - | - | |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | +### Usage |
| 30 | + |
| 31 | +```tsx |
| 32 | +import { Accordion } from '@databricks/appkit-ui'; |
| 33 | + |
| 34 | +<Accordion /* props */ /> |
| 35 | +``` |
| 36 | + |
| 37 | + |
| 38 | +## AccordionContent |
| 39 | + |
| 40 | + |
| 41 | +**Source:** [`packages/appkit-ui/src/react/ui/accordion.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/ui/accordion.tsx) |
| 42 | + |
| 43 | + |
| 44 | +### Props |
| 45 | + |
| 46 | +| Prop | Type | Required | Default | Description | |
| 47 | +|------|------|----------|---------|-------------| |
| 48 | +| `asChild` | `boolean` | | - | - | |
| 49 | +| `forceMount` | `true` | | - | Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries. | |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | +### Usage |
| 54 | + |
| 55 | +```tsx |
| 56 | +import { AccordionContent } from '@databricks/appkit-ui'; |
| 57 | + |
| 58 | +<AccordionContent /* props */ /> |
| 59 | +``` |
| 60 | + |
| 61 | + |
| 62 | +## AccordionItem |
| 63 | + |
| 64 | + |
| 65 | +**Source:** [`packages/appkit-ui/src/react/ui/accordion.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/ui/accordion.tsx) |
| 66 | + |
| 67 | + |
| 68 | +### Props |
| 69 | + |
| 70 | +| Prop | Type | Required | Default | Description | |
| 71 | +|------|------|----------|---------|-------------| |
| 72 | +| `disabled` | `boolean` | | - | Whether or not an accordion is disabled from user interaction. @defaultValue false | |
| 73 | +| `value` | `string \| string[]` | | - | The controlled stateful value of the accordion item whose content is expanded. The controlled stateful value of the accordion items whose contents are expanded. | |
| 74 | +| `asChild` | `boolean` | | - | - | |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | +### Usage |
| 79 | + |
| 80 | +```tsx |
| 81 | +import { AccordionItem } from '@databricks/appkit-ui'; |
| 82 | + |
| 83 | +<AccordionItem /* props */ /> |
| 84 | +``` |
| 85 | + |
| 86 | + |
| 87 | +## AccordionTrigger |
| 88 | + |
| 89 | + |
| 90 | +**Source:** [`packages/appkit-ui/src/react/ui/accordion.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/ui/accordion.tsx) |
| 91 | + |
| 92 | + |
| 93 | +### Props |
| 94 | + |
| 95 | +| Prop | Type | Required | Default | Description | |
| 96 | +|------|------|----------|---------|-------------| |
| 97 | +| `asChild` | `boolean` | | - | - | |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | +### Usage |
| 102 | + |
| 103 | +```tsx |
| 104 | +import { AccordionTrigger } from '@databricks/appkit-ui'; |
| 105 | + |
| 106 | +<AccordionTrigger /* props */ /> |
| 107 | +``` |
| 108 | + |
0 commit comments