コンポーネント
折りたたみ
コンテンツ領域を1つ折りたたんだり、展開したりします。
使い方
基本
Cache, workers, and build flags live here.
HTML
<bs:bsui-collapsible>
<bs:bsui-collapsible-trigger trigger_label="Show advanced options" trigger_variant="outline" />
<bs:bsui-collapsible-panel>
<bs:bsui-text content="Cache, workers, and build flags live here." variant="muted" />
</bs:bsui-collapsible-panel>
</bs:bsui-collapsible>初期状態で開く
通常読む価値のある詳細を、最初から展開して表示します。
Faster page sync, a new table block, and fourteen bug fixes.
HTML
<bs:bsui-collapsible defaultOpen="true">
<bs:bsui-collapsible-trigger trigger_label="Release notes" trigger_variant="ghost" trigger_size="sm" />
<bs:bsui-collapsible-panel>
<bs:bsui-text content="Faster page sync, a new table block, and fourteen bug fixes." variant="muted" />
</bs:bsui-collapsible-panel>
</bs:bsui-collapsible>段階的な情報開示
必要になるまで、めったに使わない選択肢を隠しておきます。
Deploy to production
Builds the current branch and swaps the live release.
HTML
<bs:bsui-card>
<bs:bsui-card-header>
<bs:bsui-card-title label="Deploy to production" />
<bs:bsui-card-description label="Builds the current branch and swaps the live release." />
</bs:bsui-card-header>
<bs:bsui-card-content>
<bs:bsui-collapsible>
<bs:bsui-collapsible-trigger trigger_label="Show advanced options" trigger_variant="ghost" trigger_size="sm" />
<bs:bsui-collapsible-panel>
<bs:bsui-stack direction="column" gap="3" align="start">
<bs:bsui-switch label="Skip the build cache" />
<bs:bsui-switch label="Warm the static pages afterwards" defaultChecked="true" />
</bs:bsui-stack>
</bs:bsui-collapsible-panel>
</bs:bsui-collapsible>
</bs:bsui-card-content>
<bs:bsui-card-footer>
<bs:bsui-button label="Deploy" />
</bs:bsui-card-footer>
</bs:bsui-card>構造
折りたたみは以下のブロックで構成されます。それぞれ独立したブロックで、親の内部でのみレンダリングされます。
bsui/collapsiblebsui/collapsible-panelbsui/collapsible-trigger
属性
| 属性 | タイプ | デフォルト |
|---|---|---|
defaultOpen | toggle | false |
disabled | toggle | false |
bsui/collapsible-panel
このブロックは属性を受け取りません。
bsui/collapsible-trigger
| 属性 | タイプ | デフォルト |
|---|---|---|
trigger | text | — |
trigger_block | text | bsui/button |
trigger_label | richtext | — |
trigger_icon | icon | — |
trigger_iconPosition | left | |
trigger_href | text | — |
trigger_variant | default | |
trigger_size | default | |
trigger_disabled | toggle | false |