Accordion

Des sections empilées qui affichent et masquent leur contenu, une ou plusieurs à la fois, selon le pattern Accordion de WAI-ARIA.

Disponible pour
  • Angular: disponible
  • Vue: disponible
  • React: disponible
  • React Native: disponible

Utilisation

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

Importation

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

Référence de l’API

SoneAccordionContentDirectiveDirective

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

Sélecteur
[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.

Sélecteur
[soneAccordion], sone-accordion
Exporté sous
soneAccordion
Inputs
NomType Par défaut
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
valuebidirectionnel

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.

Sélecteur
[soneAccordionIcon]

SoneAccordionItemDirectiveDirective

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

Sélecteur
[soneAccordionItem], sone-accordion-item
Exporté sous
soneAccordionItem
Inputs
NomType Par défaut
value

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

stringthis.uid
disabledbooleanfalse

SoneAccordionTriggerComponentComposant

`<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.

Sélecteur
sone-accordion-trigger
Inputs
NomType Par défaut
level

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

number3