アコーディオン

情報を整理するための展開・折りたたみ式コンテンツセクション。 基本(単一展開)、常時展開(複数同時展開)、ネスト型の3つのバリエーションを用意しています。

ベーシック

一度にひとつのアイテムのみ展開可能

オプション

名前 デフォルト 説明
items * Array 必須 Array of hashes with :title and :content keys
default_open Integer nil Index of initially open item (nil for all closed)
class String "" Additional CSS classes for the container

常時展開

複数のアイテムを同時に展開可能

オプション

名前 デフォルト 説明
items * Array 必須 Array of hashes with :title and :content keys
default_open Array [] Array of indices for initially open items
class String "" Additional CSS classes for the container

ネスト

階層的なコンテンツのためのアコーディオン内アコーディオン

オプション

名前 デフォルト 説明
items * Array 必須 Array of hashes with :title and :content (can include nested accordion)
default_open Array [] Array of indices for initially open items
class String "" Additional CSS classes for the container

変更履歴 v1.0.0

- v1.0.0: Initial release with basic, always-open, and nested variants
- Full keyboard accessibility
- Stimulus controller for state management

フルアクセスを取得

このコンポーネントと他のすべてのソースコードをアンロックしましょう。一回のお支払いで永久アクセス。

今すぐアクセスを取得