Accordion

コンテンツを表示・非表示にする縦に並んだセクション。一度に一つまたは複数を開け、WAI-ARIA の Accordion パターンに従います。

対応フレームワーク
  • Angular: 対応
  • Vue: 対応
  • React: 対応
  • React Native: 対応

使い方

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

インポート

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

API リファレンス

SoneAccordionContentDirectiveディレクティブ

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

セレクター
[soneAccordionContent], sone-accordion-content

SoneAccordionDirectiveディレクティブ

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

セレクター
[soneAccordion], sone-accordion
エクスポート名
soneAccordion
入力
名前型 デフォルト
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
value双方向

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

AccordionValuenull

SoneAccordionIconDirectiveディレクティブ

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

セレクター
[soneAccordionIcon]

SoneAccordionItemDirectiveディレクティブ

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

セレクター
[soneAccordionItem], sone-accordion-item
エクスポート名
soneAccordionItem
入力
名前型 デフォルト
value

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

stringthis.uid
disabledbooleanfalse

SoneAccordionTriggerComponentコンポーネント

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

セレクター
sone-accordion-trigger
入力
名前型 デフォルト
level

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

number3