Accordion

Stacked sections that show and hide their content, one or several at a time, following the WAI-ARIA Accordion pattern.

Available in
  • Angular: available
  • Vue: available
  • React: available
  • React Native: available

Usage

Standard delivery takes 3–5 working days; express arrives the next day.

Import

ts
import {
  SoneAccordionContentDirective,
  SoneAccordionDirective,
  SoneAccordionIconDirective,
  SoneAccordionItemDirective,
  SoneAccordionTriggerComponent,
} from "@surface-one/angular/accordion";

API reference

SoneAccordionContentDirectiveDirective

`[soneAccordionContent]` / `<sone-accordion-content>` — the region the trigger shows.

Selector
[soneAccordionContent], sone-accordion-content

SoneAccordionDirectiveDirective

`[soneAccordion]` / `<sone-accordion>` — a stack of headed sections that show and hide their content (WAI-ARIA Accordion). `type` single or multiple, `collapsible` (single), two-way `[(value)]` with the open item values. Up / Down, Home and End move between the triggers.

Selector
[soneAccordion], sone-accordion
Export as
soneAccordion
Inputs
NameType Default
type

`single`: one item open at a time; `multiple`: any number.

AccordionType"single"
collapsible

A `single` accordion lets its open item close again.

booleanfalse
disabled

Disables every item.

booleanfalse
valuetwo-way

The open item values: a value (or `null`) when `single`, a list when `multiple`.

AccordionValuenull

SoneAccordionIconDirectiveDirective

`[soneAccordionIcon]` — your own icon in place of the chevron; it turns when open.

Selector
[soneAccordionIcon]

SoneAccordionItemDirectiveDirective

`[soneAccordionItem]` / `<sone-accordion-item>` — one section: a trigger and its content.

Selector
[soneAccordionItem], sone-accordion-item
Export as
soneAccordionItem
Inputs
NameType Default
value

Names the item in the accordion's `value`; unique by default.

stringthis.uid
disabledbooleanfalse

SoneAccordionTriggerComponentComponent

`<sone-accordion-trigger>` — the item's heading (`role="heading"`, `level`) with the button that opens and closes it. Project an `[soneAccordionIcon]` to replace the chevron.

Selector
sone-accordion-trigger
Inputs
NameType Default
level

The heading level of the trigger (`aria-level`).

number3