Skip to main content
Designkufu

smarthr-ui-switch

Switchは、オン/オフを即時に切り替えるスイッチコンポーネントです。機能の有効/無効や表示切替をユーザー操作で即座にシステムに反映させるときに使います。

Stars
30
Source
kufu/smarthr-design-system
Updated
2026-05-29
Slug
kufu--smarthr-design-system--smarthr-ui-switch
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-switch/SKILL.md -o .claude/skills/smarthr-ui-switch.md

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

オン/オフを即時に切り替えるスイッチコンポーネントです。機能の有効/無効や表示切替をユーザー操作で即座にシステムに反映させるときに使います。

import

import { Switch } from 'smarthr-ui'

Props

Props 名 デフォルト値 必須 説明
unrecommendedLabelHidden boolean - - ラベルを視覚的に隠すかどうか

実装ルール

Switch に直接関連する eslint-plugin-smarthr のルールは現時点ではありません。

使い方チェックリスト

使用上の注意 > SegmentedControl との違い

  • [must] 異なる状態(オン/オフ以外)を表す場合は Switch ではなく SegmentedControl を使う

使用上の注意 > ラベルの表示

  • [must] Switch にはラベルをつける
    • 周囲のコンテキストによって省略できる
    • Switch の状態が切り替わってもラベルは変更しない

レイアウト > [WIP] モバイル

  • [must] モバイルでは Switch のサイズを大きくする