#026
Min, max, negative, error and disabled
Four MoneyInput fields showing min and max bounds, negative values, an error message and a disabled state.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Min, max, negative, error and disabled" pattern (@codeatlasdev/ui demo #026, inputs/money-input) in my app.
Call get_demo({ ids: ["#026"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Amount fields in payment and ledger forms that limit ranges, allow adjustments or lock a value.
Keep these library parts, with the props and tokens the demo uses:
- MoneyInput from "@codeatlasdev/ui/forms"
Behaviour to keep:
- `label="Deposit"` with `min={1000}`, `max={10000}` and `description="Between R$ 10,00 and R$ 100,00."`
- `<MoneyInput label="Adjustment" bind:value={adjustment} allowNegative />` with `let adjustment = $state(-2500)`
- `<MoneyInput label="Amount" value={0} error="Amount must be greater than zero." />`
- `<MoneyInput label="Locked" value={99900} disabled />`
- Wrapper `.col` has `max-width: 400px`
Reduced motion: the demo handles it; keep that branch.
Keyboard: operable; keep the focus order and key handling.
Change only the copy and the data. Use the theme tokens (--ca-*), never raw colours. Library parts
- MoneyInput
@codeatlasdev/ui/forms
How it is built
- `label="Deposit"` with `min={1000}`, `max={10000}` and `description="Between R$ 10,00 and R$ 100,00."`
- `<MoneyInput label="Adjustment" bind:value={adjustment} allowNegative />` with `let adjustment = $state(-2500)`
- `<MoneyInput label="Amount" value={0} error="Amount must be greater than zero." />`
- `<MoneyInput label="Locked" value={99900} disabled />`
- Wrapper `.col` has `max-width: 400px`
Related
Loading source.