メディア

Icon

手持ちのアイコン画像(SVG など)のサイズと色を整えて表示する入れ物。Lily 自体にアイコンは入っていません。

ReactVueWeb Components
Storybook で見る

プレイグラウンド

使用例

<Icon size="lg" tone="primary" label="検索"><SearchSvg /></Icon>
<Icon aria-hidden><ChevronSvg /></Icon> // decorative

設定できる項目

名前 既定値 説明
size IconSize md Size token (sets `font-size`; the icon is `1em` square). @default 'md'
tone IconTone Semantic color (uses the AAA `*-text` tokens). @default 'default' (currentColor)
label string Accessible label. When set, the icon is meaningful (`role="img"`); otherwise it is decorative and hidden from assistive tech.
children ReactNode The icon glyph — typically an inline `<svg>`.

アクセシビリティ

  • 文字と背景の明るさの差をしっかり取り、読みやすくしています。ライトでもダークでも、見やすさの国際基準 WCAG の最高ランク AAA(明るさの差が 7:1 以上)を満たします。
  • マウスがなくても、キーボードだけですべての操作ができます。
  • いまどこを操作しているかを示す枠(フォーカスの囲み)が、常にはっきり見えます。
  • 利用者が「画面の動きを減らす」設定にしているときは、過剰なアニメーションを止めます。

どのコンポーネントも、だれにとっても使いやすいように、見やすさの国際基準 WCAG の最高ランク AAA(WCAG 2.1 AAA)を満たすよう作っています。