リンクコントロール
ネイティブの動作を保ったままリンク、名前付きアイコン操作、キーボードショートカットを装飾します。
使い方
移動には ButtonLink、操作には IconButton、アイコンの移動先には IconLink または PlatformLink を使います。href と翻訳した名前は利用側が指定します。
アクセシビリティ
アイコンのみの操作には名前を付け、装飾アイコンを隠し、ショートカットには Kbd を使います。プラットフォームのホバー効果は動きの軽減設定に従います。
| プロパティ | 型 | 既定値 |
|---|---|---|
| href (links) | string | Required |
| aria-label / aria-labelledby (icon controls) | string | Required |
| platform | github | npm | Required |
| variant | primary | secondary | ghost | Native defaults |
| size | sm | md | md |
<>
<ButtonLink href="#/link-controls">Read guide</ButtonLink>
<IconButton aria-label="Open search example"><span aria-hidden="true">⌕</span></IconButton>
<IconLink href="#/link-controls" aria-label="Open reference example"><span aria-hidden="true">↗</span></IconLink>
<PlatformLinks role="group" aria-label="Platform links">
<PlatformLink platform="github" href="#/link-controls" aria-label="GitHub example" />
<PlatformLink platform="npm" href="#/link-controls" aria-label="npm example" />
</PlatformLinks>
<Kbd>Ctrl K</Kbd>
</>