Accordion

Ułożone jedna pod drugą sekcje, które pokazują i ukrywają swoją treść — jedną lub kilka naraz — zgodnie ze wzorcem Accordion z WAI-ARIA.

Dostępny w
  • Angular: dostępny
  • Vue: dostępny
  • React: dostępny
  • React Native: dostępny

Użycie

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";

Dokumentacja API

SoneAccordionContentDirectiveDyrektywa

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

Selektor
[soneAccordionContent], sone-accordion-content

SoneAccordionDirectiveDyrektywa

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

Selektor
[soneAccordion], sone-accordion
Eksport jako
soneAccordion
Wejścia
NazwaTyp Domyślnie
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
valuedwukierunkowe

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

AccordionValuenull

SoneAccordionIconDirectiveDyrektywa

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

Selektor
[soneAccordionIcon]

SoneAccordionItemDirectiveDyrektywa

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

Selektor
[soneAccordionItem], sone-accordion-item
Eksport jako
soneAccordionItem
Wejścia
NazwaTyp Domyślnie
value

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

stringthis.uid
disabledbooleanfalse

SoneAccordionTriggerComponentKomponent

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

Selektor
sone-accordion-trigger
Wejścia
NazwaTyp Domyślnie
level

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

number3