Provides a single-line text/number input component for SmartHR UI forms, with accessibility linting rules and usage guidelines.
How this skill is triggered — by the user, by Claude, or both
Slash command
/smarthr-design-system:smarthr-ui-inputThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
input[type='text']やinput[type='number']などの代替としてテキストや数値を1行で入力させるコンポーネントです。テキスト・数値を1行で入力させるとき、フォームに入力欄を追加するときに使います。
input[type='text']やinput[type='number']などの代替としてテキストや数値を1行で入力させるコンポーネントです。テキスト・数値を1行で入力させるとき、フォームに入力欄を追加するときに使います。
input[type="text"]やinput[type="number"]などの代替としてテキストや数値を1行で入力させるコンポーネントです。テキスト・数値を1行で入力させるとき、フォームに入力欄を追加するときに使います。
import { Input } from 'smarthr-ui'
| Props 名 | 型 | デフォルト値 | 必須 | 説明 |
|---|---|---|---|---|
| placeholder | string | - | - | @deprecated placeholder属性は非推奨です。別途ヒント用要素を設置するか、それらの領域を確保出来ない場合はTooltipコンポーネントの利用を検討してください。 |
| type | string | - | - | input 要素の type 値 |
| width | string | number | - | - | コンポーネントの幅 |
| autoFocus | boolean | - | - | オートフォーカスを行うかどうか |
| prefix | ReactNode | - | - | コンポーネント内の先頭に表示する内容 |
| error | boolean | - | - | フォームにエラーがあるかどうか |
| suffix | ReactNode | - | - | コンポーネント内の末尾に表示する内容 |
| bgColor | "BACKGROUND" | "COLUMN" | "BASE_GREY" | "OVER_BACKGROUND" | "HEAD" | "BORDER" | "ACTION_BACKGROUND" | - | - | 背景色。readOnly を下地の上に載せる場合に使う |
input, textarea, select など入力要素に name 属性を設定することを強制するルールです。
❌ NG:
// name属性が存在しないためNG
<RadioButton />
<Input type="radio" />
<input type="text" />
<Textarea />
<Select />
✅ OK:
<RadioButton name="hoge" />
<Input type="radio" name="fuga" />
<input type="text" name="any" />
<Textarea name="some" />
<Select name="piyo" />
入力要素をsmarthr-ui/FormControl、もしくはsmarthr-ui/Fieldsetで囲むことを促すルールです
❌ NG:
// FormControlで囲まれていないためNG
<Input />
// FormControlが複数の入力要素を持ってしまっているのでNG
<FormControl title="any heading">
<Input />
<Combobox />
</FormControl>
✅ OK:
<FormControl title="any heading">
<Input />
</FormControl>
input, textarea 要素に maxLength 属性を設定することを禁止するルールです。
input や textarea などの入力要素に対してplaceholder属性を設定することを禁止するルールです
❌ NG:
<Input placeholder="hoge" />
✅ OK:
<>
<Input />
<Hint>hoge</Hint>
</>
詳細は eslint-plugin-smarthr の各ルール README を参照してください。
helpMessage や exampleMessage を用い別途表示するtooltipMessage を使用して入力内容に対する説明を補足するprefix)の要素は入力内容を想起させるために使用する
suffix)のアイコンは操作を想起させるため、または操作を提供するために使用する
yyyy/mm/dd + オブジェクト名 のようにデフォルト値を設定するのを推奨するreadOnly を使用するdisabled を使用する
readOnly の使用を検討するM 以上を使用するnpx claudepluginhub kufu/smarthr-design-system --plugin smarthr-design-systemProvides guidance for using SmartHR UI FormControl component: attaching labels, help/error messages, and required indicators to single input elements. Includes a11y linting rules.
Designs forms with progressive disclosure, smart defaults, forgiving formats, and error recovery. Guides validation timing (blur, keystroke, submit) and single-column layout for faster completion.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.