Accordion

Accordion

import Accordion, { AccordionSection } from "@kiwicom/orbit-components/lib/Accordion";
<Accordion>
<AccordionSection>Hello World!</AccordionSection>
</Accordion>

Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeThe content of the Accordion. You can use only AccordionSection
expandedSectionstring \| numberOptional prop to control which AccordionSection (by id) is expanded
loadingbooleanIf true it will render the Loading component
onExpand(sectionId: string \| number) => void \| Promise<any>Callback (along with sectionId) that is triggered when section is expanding
dataTeststring
idstringSet id for Accordion
spaceAfter"none" \| "smallest" \| "small" \| "normal" \| "medium" \| "large" \| "largest"

AccordionSection

Props

NameTypeRequiredDefaultDescription
idstring \| number
childrenReact.ReactNode
actionsReact.ReactNode
expandedboolean
expandableboolean
expandOnTileClickbooleanfalseIf true, enables mobile-first interaction where the entire header area becomes clickable for expansion.
onExpandCommon.Callback
headerReact.ReactNode
footerReact.ReactNode
dataTeststring

Callback

Callback
() => void \| Promise<void>