<Accordion> Component

<Accordion> represents a series of toggleable collapsing content.

Here the demo:

Preview
  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

Installing <Accordion> Component

There are 2 ways to install <Accordion> component into your react app project:

  • Install the Specific Package of <Accordion> Component
  • Install the Whole Reusable-UI Component Pack, including the <Accordion> Component

expanded Property

Expands/Collapses the <AccordionItem>.

The possible values are:

  • undefined
  • true
  • false

defaultExpanded Property

Defines the initial expanded state when the <AccordionItem> is first loaded.

The possible values are:

  • undefined
  • true
  • false

onExpandedChange Property

Sets a callback function to be called when the user closes the <AccordionItem>.

The callback function parameters:

  • event: ExpandedChangeEvent

lazy Property

Determines whenever the <AccordionItem>'s children should be rendered or not when the <AccordionItem expanded={false}>.

You can set the lazy individually for each <AccordionItem>.

The possible values are:

  • undefined
  • false
  • true

Variant Properties

The alternative appearances of the <Accordion> layout without changing the <Accordion>'s functionality.

listStyle Property

Sets the alternative appearances of the <Accordion>.

The possible values are:

  • undefined
  • 'regular'
  • 'flat'
  • 'flush'
  • 'joined'
  • 'content'
  • 'button'
  • 'breadcrumb'
  • 'numbered'


Here the preview:

Preview
  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

Show code

orientation Property

Sets the orientation of the <Accordion>.

The possible values are:

  • undefined
  • 'inline'
  • 'block'

Here the preview:

Preview
  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

Show code

size Property

Defines the alternative size of the <Accordion>.

You can set the size individually for each <AccordionItem>.

The possible values are:

  • undefined
  • 'sm'
  • 'md'
  • 'lg'

Here the preview:

Preview
  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

Show code

theme Property

Defines the contextual theme of the <Accordion>.

You can set the theme individually for each <AccordionItem>.

The possible values are:

  • undefined
  • 'primary'
  • 'secondary'
  • 'success'
  • 'info'
  • 'warning'
  • 'danger'
  • 'light'
  • 'dark'

Here the preview:

Preview
  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

Show code

gradient Property

Activates a 3D mode of the <Accordion>.

You can set the gradient individually for each <AccordionItem>.

The possible values are:

  • undefined
  • 'inherit'
  • true
  • false

Here the preview:

Preview
  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

Show code

outlined Property

Activates an outlined mode (background-less, contrast foreground, and contrast border) of the <Accordion>.

You can set the outlined individually for each <AccordionItem>.

The possible values are:

  • undefined
  • 'inherit'
  • true
  • false

Here the preview:

Preview
  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

Show code

mild Property

Activates a mild mode (mild background, contrast foreground, and contrast border) of the <Accordion>.

You can set the mild individually for each <AccordionItem>.

The possible values are:

  • undefined
  • 'inherit'
  • true
  • false

Here the preview:

Preview
  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

Show code

State Properties

The conditions of the <Accordion> behavior or functionality.

enabled Property

Defines the enabled/disabled state of the <Accordion>.

You can set the enabled individually for each <AccordionItem>.

The possible values are:

  • undefined
  • true
  • false

Here the preview:

Preview
  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

Show code

inheritEnabled Property

Influences the <Accordion>'s disabled state by <ancestor enabled={false}>.

You can set the inheritEnabled individually for each <AccordionItem>.

The possible values are:

  • undefined
  • true
  • false

Here the preview:

Preview
  • A first item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A second item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A third item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

  • A fourth item

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

Show code

Component Properties

Overwrites the internal (sub) components used as the composition of <Accordion> component.

listComponent Property

Overwrites the internal <List> component used as the composition of <Accordion> component.

<Accordion listComponent={
    <MyCustomList />
} />

listItemComponent Property

Overwrites the internal <ListItem> component used as the composition of <AccordionItem>'s header.

<AccordionItem listItemComponent={
    <MyCustomListItem />
} />

bodyComponent Property

Overwrites the internal <ListItem> component used as the composition of <AccordionItem>'s content.

<AccordionItem bodyComponent={
    <MyCustomListItem />
} />

Variables

There are several variables of <Accordion> you can customize. Changing the variables affects all <Accordion> instance and other components that depend on <Accordion>.

Here the exposed variables:

  • No variable yet

The example of accessing, modifying, & adding variables:

Show code