Amount Input
An input for money that formats the value as the user types.
- Status
- ReadyBuild day 20 of 21
- Code
- In React
- Role
- Form
Usage
This demo is live, and the code below it is the same code, imports included. The component lives in src/ui of this repository and is not published to npm yet.
Minimum Rp10.000
Pastes as editable layers. Shadows are not exported.
import { useState } from "react";
import { AmountInput } from "@/ui";
export default function AmountDemo() {
const [amount, setAmount] = useState<number | null>(null);
return <AmountInput label="Amount" value={amount} onChange={setAmount} hint="Minimum Rp10.000" />;
}Variants and states
Every specimen is the real component from src/ui, held in one state.
Minimum Rp10.000
Minimum Rp10.000
Minimum Rp10.000
Pastes as editable layers. Shadows are not exported.
Props
- label
- string · default none
- Required.
- value, onChange
- number | null · default none
- The amount in rupiah, as a number.
- defaultValue
- number | null · default none
- size
- "sm" | "md" | "lg" · default "md"
- Field 44, 48, 56.
- hint, error
- string · default none
- placeholder
- string · default "0"
- disabled
- boolean · default none
Figma to code
Figma properties by their exact names from Naming, and the React prop that carries each one. The table covers the shared properties that bear on this component; the Figma file decides which of them its component exposes. None means there is no prop for it yet.
- 📐 Size
- size
- sm, md, or lg.
- 🎯 State
- value, error, disabled
- Hover and focus come from the browser.
- Show Label, Label
- label
- Same.
- Show Helper Text, Helper Text
- hint
- Pass to show.
- Placeholder
- placeholder
- Same.
Accessibility
What the code in src/ui does today, and what it leaves to you.
Keyboard
- A text input with inputMode=numeric, so phones show the number pad.
Screen readers
- Named by the label. The Rp prefix is visual; say rupiah in the label if it is not obvious.
What you still need to do
- Validate the minimum and maximum on the number, not on the formatted text.
When to use
Transfer, top-up, and payment amounts.
Do and don't
Do
- Show the currency (Rp) next to the value.
- Show the limit or balance close to the field.
Don't
- Accept letters or more than one decimal separator.
- Reformat the value in a way that moves the cursor.
Related
4 of 28 other molecules, same role and ready ones first.
- ComboboxAn input that suggests matching options as the user types.Ready
- Date PickerChooses a date from a calendar or by typing.Ready
- File InputLets people choose or drop a file to upload.Ready
- InputA field for entering short text, numbers, or other data.Ready
Status reflects the component tracker snapshot of 29 October 2026.