Skip to main content
Designkufu

smarthr-ui-td-radio-button

TdRadioButtonは、RadioButtonを内包するデータセル(Td)の派生コンポーネントです。テーブル各行から1行だけ選ばせるときに使います。

Stars
30
Source
kufu/smarthr-design-system
Updated
2026-05-29
Slug
kufu--smarthr-design-system--smarthr-ui-td-radio-button
View on GitHubRaw SKILL.md

// install — copy + paste into any project

mkdir -p .claude/skills && curl -fsSL https://raw.githubusercontent.com/kufu/smarthr-design-system/HEAD/plugins/smarthr-design-system/skills/smarthr-ui-td-radio-button/SKILL.md -o .claude/skills/smarthr-ui-td-radio-button.md

Drops the SKILL.md into .claude/skills/smarthr-ui-td-radio-button.md. Works with Claude Code, Cursor, and any agent that loads SKILL.md files from .claude/skills/.

RadioButtonを内包するデータセル(Td)の派生コンポーネントです。テーブル各行から1行だけ選ばせるときに使います。

他のコンポーネントと組み合わせることが多いため、具体的な使用方法はよくあるテーブル(https://smarthr.design/products/design-patterns/smarthr-table/)を参照してください。

import

import { TdRadioButton } from 'smarthr-ui'

Props

Props 名 デフォルト値 必須 説明
aria-labelledby string - - RadioButtonのaccessible nameとして設定するテキストを参照するためのid属性値。同じ親Tr配下のTdかTh、もしくはその子孫要素のidを指定する。複数要素のテキストを指定する場合は空白区切りでidをつなぐ Identifies the element (or elements) that labels the current element. @see aria-describedby.
vAlign "middle" | "baseline" - - -

実装ルール

a11y-prohibit-checkbox-or-radio-in-table-cell

テーブルセル(Th, Td)内に直接 Checkbox, RadioButton を配置することを禁止するルールです。
SmartHR UI には、デフォルトでアクセシブルネームを設定する TdCheckbox, ThCheckbox, TdRadioButton といったより適切なコンポーネントが用意されています。

✅ OK:

<TdCheckbox aria-labelledby="id1" />
<TdRadioButton aria-labelledby="id2" />
<ThCheckbox />

詳細は eslint-plugin-smarthr の各ルール README を参照してください。

使い方チェックリスト

アクセシビリティ > セル内にチェックボックスやラジオボタンをそのまま配置しない

  • [avoid] セルの内部に Checkbox や RadioButton をそのまま配置せず、TdCheckbox / ThCheckbox / TdRadioButton を利用する

アクセシビリティ > TdCheckboxおよびTdRadioButtonでは行を特定できる要素をIDで参照する

  • [must] TdCheckbox および TdRadioButton を利用する場合は aria-labelledby 属性を必ず指定し、それだけで行を一意に判別できる要素への ID 参照を指定する
  • [must] オブジェクト名だけで一意に判別できないオブジェクトでは、複数の要素の ID 参照をスペース区切りで指定する