Skip to main content
Designkufu

smarthr-ui-currency-input

CurrencyInputは、金額を入力させるためのコンポーネントです。給与・税額など金額値を入力させるときに使います。

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

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

金額を入力させるためのコンポーネントです。給与・税額など金額値を入力させるときに使います。入力値が整数であった場合、入力欄からフォーカスを外したときに3桁ごとにカンマが入った値で表示されます。

import

import { CurrencyInput } from 'smarthr-ui'

Props

Props 名 デフォルト値 必須 説明
placeholder string - - @deprecated placeholder属性は非推奨です。別途ヒント用要素を設置するか、それらの領域を確保出来ない場合はTooltipコンポーネントの利用を検討してください。
value string - - 通貨の値
width string | number - - コンポーネントの幅
defaultValue string - - デフォルトで表示する通貨の値
autoFocus boolean - - オートフォーカスを行うかどうか
prefix ReactNode - - コンポーネント内の先頭に表示する内容
error boolean - - フォームにエラーがあるかどうか
suffix ReactNode - - コンポーネント内の末尾に表示する内容
bgColor "BACKGROUND" | "COLUMN" | "BASE_GREY" | "OVER_BACKGROUND" | "HEAD" | "BORDER" | "ACTION_BACKGROUND" - - 背景色。readOnly を下地の上に載せる場合に使う
onFormatValue (value: string) => void - - 入力値がフォーマットされたときに発火するコールバック関数

実装ルール

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

使い方チェックリスト

使用上の注意 > 金額入力にはCurrencyInputを使用する

  • [must] 金額入力には <Input type="number"> の代わりに CurrencyInput を使う

使用上の注意 > プレフィックス・サフィックスで単位を補足する

  • [must] 通貨記号や単位は prefix または suffix で補足する
    • 一般的に内容に対して前方に置かれる単位(例: 米ドル)には prefix を用いる
    • 後方に置かれる単位(例: 日本円)には suffix を用いる