.finally(React)

English
Copyright © 2023-currentdotfinally, LLC

Accordion

Expand your world

The Accordion component can be used by importing { Accordion } from "finallyreact".

The { AccordionGroup } component can be used to control multiple Accordion components at once.

Example

Accordion Title
Accordion open text
Example

Rounded

Accordion Title
Accordion open text
Rounded

Header Styles

Accordion Title
Accordion open text
Header Styles

Custom Header

Accordion open text
Custom Header

Custom Content

Accordion Title

Check this out

Custom Content

Accordion Group - Single

Accordion 1
Accordion open text
Accordion 2
Accordion open text
Accordion 3
Accordion open text
Accordion Group - Single

Accordion Group - Multi

Accordion 1
Accordion open text
Accordion 2
Accordion open text
Accordion 3
Accordion open text
Accordion Group - Multi

Disabled

Accordion Title
Accordion open text
Disabled

Simple

Simple Title
Simple Text
Simple

Accordion Props

Prop NameProp TypeDescription
arrowPropsHTMLAttributesProps for the arrow
contentPropsHTMLAttributesProps for the content
customHeaderReact.ReactNodeCustom header for the accordion
disabledbooleanDisables user interaction
headerPropsHTMLAttributesProps for the header
initialOpenbooleanWhether the accordion is open by default
openbooleanWhether the accordion is open
preventAutoOpenbooleanDisables the default open behavior on clicking the header. Useful when external logic determines the open state.
roundedbooleanRounded accordion
simplebooleanA simple accordion with no styles
textstringText content for the accordion
titlestring | React.ReactNodeTitle for the accordion
titleHeaderbooleanWhether the title is rendered as an h3 header element
titlePropsHTMLAttributesProps for the title

AccordionGroup Props

Prop NameProp TypeDescription
itemsIAccordion[]Array of accordion items (above)
onOpen(index: number) => voidCallback for when an accordion is opened
selectedPropsIAccordionProps for the selected accordion
type'single' | 'multi'Type of accordion group (single or multi)