Skip to content

Accordion ​

Sections stacked under each other, with one or several open at a time.

A courier in the city costs $15, and orders over $500 ship free. Pickup is always free.

Installation ​

ts
import { NuiAccordion, NuiAccordionItem } from '@numior/kit';

Usage ​

Change the look and open one section at a time or several at once.

variant
Style: plain without a frame, card puts each section in a card.

Examples ​

Open several sections ​

Add multiple and keep the open sections in v-model:values.

A courier brings order 20411 to Austin on September 28, between 10 am and 6 pm.
Bank transfer, the invoice went to nina.hart@example.com.

Behavior ​

Without multiple, v-model holds the value of the open section, or null when all are closed. With :collapsible="false", a second click leaves the open section open: it closes only when another one opens.

Accessibility ​

Section headings are buttons, and a screen reader says whether a section is open. The up and down arrows move between headings and wrap around; Home and End jump to the first and the last. The keys work only on a heading: in a field inside a section they move the caret as usual.

Keys
Action
↓
Moves the focus to the next heading, from the last one to the first.
↑
Moves the focus to the previous heading, from the first one to the last.
Home
Moves the focus to the first heading.
End
Moves the focus to the last heading.
↵
Opens or closes the section.
Space
Opens or closes the section.

API ​

NuiAccordion

Props

Name
Type
Default
Description
id
string
—
Id attribute of the root element.
multiple
boolean
false
Lets several sections stay open at once. The values model holds them.
collapsible
boolean
true
Closes the open section on a second click on its heading.
variant
NuiCollapsibleVariant
"plain"
Style: plain without a frame, card puts each section in a card.
headingLevel
NuiHeadingLevel
—
Wraps the section headings in h2–h6, so the sections appear in the page outline. Without it the heading is a div.
disabled
boolean
false
Turns off every section heading: no section opens or closes.

Models

Name
Type
Default
Description
v-model
string | null
null
Value of the open section, or null when every section is closed.
v-model:values
string[]
[]
Values of the open sections when multiple is on.

Slots

Name
Slot props
Description
default
any
NuiAccordionItem sections.

NuiAccordionItem

Props

Name
Type
Default
Description
valuerequired
string
—
Value that goes into the accordion model while the section is open.
label
string
—
Heading text.
disabled
boolean
false
Turns off the section heading: the section does not open or close, and an open one stays open.

Slots

Name
Slot props
Description
trigger
NuiCollapsibleTriggerSlot
Custom section heading. Receives open, whether the section is open.
default
any
Section content.

Edit this page

Search

Esc