Lapikit

Accordion component

Accordion

An Accordion lets you group content into collapsible sections. It improves legibility and saves space in an interface, while offering precise control over the display of information.

Examples of accordion

Base

The minimal example of an Accordion: a parent container with one or more children. Each item can be opened or closed independently (or not, depending on the configuration).

Icon

By default, an indicator icon (often an arrow or chevron) is displayed to indicate open/closed status. This icon can be customized via a snippet or hidden using the hideIcon prop.

Multiple

The Accordion can open several items at the same time. In this mode, each item has its own independent state, ideal for presenting several blocks of information simultaneously.

Read Only

Some items can be made read-only with the readOnly prop. This disables interactions (click, open/close) while keeping the item visible in the chord structure.

Content section 1

Content section 2

Content section 3

Snippet

You can enrich or customize the rendering with predefined snippets, allowing you to add icons, dynamic content, action buttons in the header, etc. Lapikit offers activator and indicator inputs.

Spacer

Prop spacer adds vertical spacing between chord items. Useful for adding a little air to dense or visually busy interfaces.

API Reference

Root

propstypedescriptiondefaulttype_extend
ref $bindableHTMLElementDirect access to DOM elementundefined
isstringDefines the HTML tag used for the main wrapper (e.g. section, ul, etc.).div
darkbooleanEnable dark theme for component.false
lightbooleanEnable light theme for the component.false
colorstringApplies a custom color to text or icons.undefined
backgroundstringApply a custom background color.undefined
spacerbooleanAdds spacing between child elements.false
hideIconbooleanHides the indicator icon (arrow, chevron, etc.) for each item.false

Item

propertytypedescriptiondefaulttype_extend
index requirednumber | stringUnique item identifier. Used to manage opening/closing.undefined
ref $bindableHTMLElementDirect access to DOM elementundefined
isstringDefines the item’s HTML tag.div
open $bindablebooleanControls item opening status (bindable for external use).false
darkbooleanEnable dark theme for the item.false
lightbooleanEnable light theme for the item.false
textstringItem title or static text
colorstringApplies a custom color to text or icons.undefined
backgroundstringApply a custom background color.undefined
roundedstringControls item rounding (none, sm, md, lg, etc.).md
readOnlybooleanPrevents any user interaction with the item (click, toggle, etc.).false
disabledbooleanDisables item interaction and applies an associated visual style.false
togglevoidCallback function called when the item is toggled. Allows manual control of opening/closing.undefined(index: number | string) => void
indicatorSnippetSnippet for customizing the visual indicator (arrow, chevron, etc.).undefinedopen[]
activatorSnippetSnippet used to customize the trigger (clickable header).undefined

Variables CSS

Root

variabledefaultdescription
–-accordion-color–-kit-on-containerText color global
–-accordion-background–-kit-containerBackground color global
–-accordion-radius–-kit-radius-mdAccordion edge radius global

Item

variabledefaultdescription
–-on–-accordion-colorText color item
–-base–-accordion-backgroundBackground color item
–-shape–-accordion-radiusAccordion edge radius item

To complete your Accordion interface, consider the Icon and Chip components for dynamic content.

©2025 Lapikit.

Made with by Nycolaide