Skip to content

components/Accordion

import { … } from 'zidane-ui'ui/src/components/Accordion.tsx

Components#

AccordionComponent#

Renders sections with headers that open and close them. Several can be open at once.

TypeScript
function Accordion(props: AccordionProps): Element
Parameters
NameTypeDescription
propsAccordionProps

AccordionProps.

Element
Accordion props
NameTypeDescription
className?string

Extra classes on the root element.

itemsreadonly AccordionItem[]

The sections, in order.

style?CSSProperties

Inline styles on the root element.

ui/src/components/Accordion.tsx:38

Interfaces#

AccordionItemInterface#

One section of an Accordion.

TypeScript
interface AccordionItem
AccordionItem properties
NameTypeDescription
contentReactNode

The body the section shows when open.

defaultOpen?boolean

Open at first.

idstring

Stable id, unique among the items.

titleReactNode

The header text.

ui/src/components/Accordion.tsx:12

AccordionPropsInterface#

Props for Accordion.

TypeScript
interface AccordionProps
AccordionProps properties
NameTypeDescription
className?string

Extra classes on the root element.

itemsreadonly AccordionItem[]

The sections, in order.

style?CSSProperties

Inline styles on the root element.

ui/src/components/Accordion.tsx:24