Accordion

Secciones apiladas que muestran y ocultan su contenido, una o varias a la vez, siguiendo el patrón Accordion de WAI-ARIA.

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

Uso

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

Importación

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

Referencia de la API

SoneAccordionContentDirectiveDirectiva

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

Selector
[soneAccordionContent], sone-accordion-content

SoneAccordionDirectiveDirectiva

`[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
Exportar como
soneAccordion
Inputs
NombreTipo Predeterminado
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
valuebidireccional

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

AccordionValuenull

SoneAccordionIconDirectiveDirectiva

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

Selector
[soneAccordionIcon]

SoneAccordionItemDirectiveDirectiva

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

Selector
[soneAccordionItem], sone-accordion-item
Exportar como
soneAccordionItem
Inputs
NombreTipo Predeterminado
value

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

stringthis.uid
disabledbooleanfalse

SoneAccordionTriggerComponentComponente

`<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
NombreTipo Predeterminado
level

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

number3