trigger
React.ReactNode
children
React.ReactNode
open
boolean
false
onOpenChange
(open: boolean) => void
defaultOpen
boolean
Use the trigger
prop to render anything that should open the accordion on click.
Accordion.Content
is a wrapper component for content shown when the accordion is open. Accordion.Chevron
is a chevron icon that will automatically rotate.
View code
Use open
and onOpenChange
props to control the open state.
View code
Use defaultOpen
prop to have the accordion open when initially rendered. If you need to control the component, you should use open
and onOpenChange
props instead.
View code