Skip to content
fandhe-frontend
GitHub

Alert

fandhe-frontend-pre-styled-uialert mod が提供するスタイル済み Alert 部品です。

ユーザーへ注意喚起・状態変化を伝える部品です。role="alert" を状態に関わらず固定で付与するため、四つの状態(Info/Success/Warning/Error)いずれでもスクリーンリーダーへ通知が届きます。値の変化を伴わない静的な警告表示には Status を、一時的な進捗通知には Progress を検討してください。

関連 API: fandhe-frontend-pre-styled-ui API

Demo

status(info / success / warning / error)で色が切り替わる通知領域。root / indicator / content / title / description の slot 構成です。

Features

  • AlertStatus(Info/Success/Warning/Error、crates/pre-styled-ui/src/alert.rs:24-33)で 4 種の状態色を切り替える
  • root に WAI-ARIA live region の role="alert" を状態に関わらず固定付与する(alert.rs:153, 4)
  • indicator/content/title/description の 4 パーツで見出し・本文を構造化できる(alert.rs:163-181)

Anatomy

root
  indicator
  content
    title
    description

API Reference

Arguments

NameTypeDefaultDescription
statusAlertStatusInfo見た目の状態色(alert.rs:24-33、#[default] は Info)。

Examples

Warning

Warning 状態の Alert を indicator + title/description で組み立てた例です。

Accessibility

WAI-ARIA

AttributeDescription
role="alert"WAI-ARIA live region。status の値に関わらず固定で付与される(alert.rs:4, 153)。