本文へ移動
uiify

Fieldset

A semantic group of related form controls named by a legend.

ブラウザー
Chrome 123+Firefox 121+Safari 17.5+
ティア
0
強制レイアウトの上限
0 ms
axe の上限
0
SSR 対応
はい
公開された契約
テストハーネス

プレイグラウンド

Fieldset / Legend

デフォルト

Contact preferences

使用例

Grouped preferences

Use the first-child legend to name the group and keep a native label on each control.

Fieldset / Legend

Default

Contact preferences
import { Checkbox, Fieldset, FieldsetLegend } from "@gunkin/uiify";

export default function Example() {
  return (
    <Fieldset>
      <FieldsetLegend>Contact preferences</FieldsetLegend>
      <Checkbox id="contact-email" label="Email" name="contact" value="email" />
      <Checkbox id="contact-sms" label="Text message" name="contact" value="sms" />
    </Fieldset>
  );
}

API

Fieldset

Prop型既定値説明
childrenReactNode—Grouped controls and a first-child FieldsetLegend.
className / style / ref / native fieldset propsnative fieldset props—Native fieldset props, styles, events, and ref are forwarded.
renderReactElement | ((props, state) => ReactElement)—動作とアクセシビリティの接続を維持したまま、描画する要素を置き換えます。

FieldsetLegend

Prop型既定値説明
childrenReactNode—Visible group name rendered as the native legend.
renderReactElement | ((props, state) => ReactElement)—動作とアクセシビリティの接続を維持したまま、描画する要素を置き換えます。

キーボード

キー操作

アクセシビリティ

Fieldset and Legend render native fieldset and legend elements. Put FieldsetLegend first to name the group; each contained control still needs its own label. No synthetic group role or hidden legend is added.

スタイリングのフック

data-uiify-fieldsetdata-part="root|legend"