The accordion component organizes content into collapsible sections, allowing users to toggle between expanded and collapsed states.
Accordion Preview

Usage

Image without caption
An accordion consists of the following parts:
  • AccordionItem: A container for each collapsable section.
  • AccordionTrigger: A button that expands and collapses its associated content.
  • AccordionContent: The collapsible area that holds the content for each accordion item.

Adding an Accordion

To add an Accordion to your page, follow these steps:
  1. Open the Insert Menu and navigate to Components.
  1. Click or drag the Accordion onto your desired location on the page.
Icon
Pro tip
Add more accordion items through the Insert Menu—press I, then use the search bar to find AccordionItem.
Icon
Pro tip
Quickly duplicate accordion items in the composition by selecting AccordionItem and pressing Cmd + D.

Guides

Here are practical examples of how to configure the accordion component:

Expanded by Default

To set a specific accordion item to expand by default:
  1. Select the accordion component and navigate to the properties panel.
  1. Set the defaultValue to a specific value (e.g., 0). If set to 0, the first item will expand; if set to 1, the second item will expand, and so on.

Expand Multiple Items

To allow more than one accordion item to be expanded simultaneously, follow these steps:
  1. Select the accordion component and go to the properties panel.
  1. Set the type to multiple.
  1. Use the defaultValue property to define which items should be expanded by default (e.g., 0,1).

Disabled Item

To disable a specific accordion item, follow these steps:
  1. Select the accordion item you want to disable.
  1. In the properties panel, set the disabled property to true.
This will prevent users from interacting with the selected item, meaning it can't be expanded or collapsed.

Disabling the Entire Accordion

To disable all accordion items and prevent users from interacting with the accordion entirely:
  1. Select the accordion component.
  1. In the properties panel, set the disabled property to true.

Changing the Icon

To replace the trigger icon, follow these steps:
  1. Select the trigger icon in the composition tree.
  1. Open the Insert menu and navigate to Icons.
  1. Hold Option (Mac) or Alt (Windows) and click on the desired icon to replace the currently selected one. This will swap the icon instead of inserting a new one.

Repositioning the Icon

To reposition the icon within the accordion trigger, follow these steps:
  1. Select the trigger icon in the composition tree.
  1. Drag the icon above or below the trigger text to adjust its position.

Adjusting Icon Animations

By default, the trigger icon rotates by 180° when expanded. You can modify the rotation or apply other animation effects. For example, to change the rotation from 180° to -90°:
  1. Select the trigger icon and navigate to the properties panel.
  1. In the Classes input, locate and select the rotate class.
  1. Click on the open state to view its applied styles.
  1. Scroll to the Effects section and find the Transform panel.
  1. Click on the Rotate item and adjust the Z value to -90deg.
You can also apply other effects like scaling, fading, or adding a bounce effect in the Effects section.

Changing the Background

To change the background color of the accordion content:
  1. Select the AccordionContent component.
  1. Open the Style Panel and navigate to the Background section.
  1. Choose a solid color, gradient, or image as the background.
  1. Optionally, adjust the text color in the Typography section to ensure readability against the new background.

Changing the Border

To customize the border of the accordion:
  1. Select the AccordionTrigger or AccordionContent component.
  1. Open the Style Panel and navigate to the Border section.
  1. Adjust the border width and color as needed.

Properties

Accordion

Property
Type
Default
Description
collapsible
boolean
true
Determines whether users can close an expanded item by clicking its trigger (only applies when type="single").
type
"single"
"multiple"
Determines if only one or multiple sections can be expanded at the same time.
disabled
boolean
false
If true, prevents the user from interacting with the accordion and all its items.
defaultValue
string
-
Specifies which accordion items should be expanded when the component first renders. When type="single", use a single value (e.g., "0" or "item-0"). When type="multiple", use multiple values separated by commas or spaces (e.g., "0,1,2", "item-0 item-1 item-2"). If no values are set on accordion items, they can be expanded based on their order, starting from 0.

AccordionItem

Property
Type
Default
Description
value
string
-
A unique value for the item.
disabled
boolean
false
If true, prevents the user from interacting with the item.

AccordionTrigger

Property
Type
Default
Description
tag
“h1” | “h2” | “h3” | “h4” | “h5” | “h6”
“h3”
Specifies the HTML tag used.

Powered by Notaku