Skip to content
fandhe-frontend
GitHub

Popover

fandhe-frontend-pre-styled-uipopover mod が提供するスタイル済み Popover 部品です。 トリガー起点のオーバーレイで、contentrole="dialog" を固定付与し、 title/description が設定されているときのみ aria-labelledby/ aria-describedby をセットで付与します。開閉は Disclosure を埋め込んだ 状態機械 Popover が管理します。

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

Demo

headless-ui の Popover(role="dialog"、非モーダル)に pre-styled-ui の recipe CSS を適用した静的掲示です。positioner はフロー内配置へ中和しています(実際の overlay 配置は recipe CSS が担います)。

Features

  • トリガー起点のオーバーレイ。Root / Trigger / Anchor / Positioner / Arrow / ArrowTip / Content / Title / Description / CloseTrigger / Indicator の 11 anatomy パーツを持つ。
  • 開閉は Disclosure を埋め込んだ状態機械 Popover が管理する。
  • content に role="dialog" を固定付与し、title / description が設定されているときのみ aria-labelledby / aria-describedby をセットで付与する。

Anatomy

root
  trigger
  positioner
    content
      title
      description
      close-trigger

API Reference

Arguments

NameTypeDefaultDescription
stateOpenState開閉状態(Open/Closed)。root/content の data-state へ反映される。

Data Attributes

PartAttributeObserved Values
contentdata-stateopen
positionerdata-stateopen
rootdata-stateopen
triggerdata-stateopen

Accessibility

WAI-ARIA

AttributeDescription
aria-haspopup="dialog"trigger に固定付与。
aria-expanded / aria-controlstrigger に付与。開閉状態と対応する content の id を表す。
role="dialog"content に固定付与。
aria-labelledby / aria-describedbycontent に付与。対応する title/description が設定されているときのみ出力される。