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
onExpandCommon.Callback
headerReact.ReactNode
footerReact.ReactNode
dataTeststring

Callback

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