#028
Default
A default MoneyInput bound to a cents value, with the raw cents and formatted display printed below.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Default" pattern (@codeatlasdev/ui demo #028, inputs/money-input) in my app.
Call get_demo({ ids: ["#028"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: A price or amount field where the model stores integer cents and the UI shows a formatted amount.
Keep these library parts, with the props and tokens the demo uses:
- MoneyInput, centsToDisplay from "@codeatlasdev/ui/forms"
Behaviour to keep:
- `<MoneyInput label="Price" bind:value={price} />`
- `let price = $state(123456)` holds cents
- Output line prints `{price} cents → {centsToDisplay(price)}`
- 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
- `<MoneyInput label="Price" bind:value={price} />`
- `let price = $state(123456)` holds cents
- Output line prints `{price} cents → {centsToDisplay(price)}`
- Wrapper `.col` has `max-width: 400px`
Related
Loading source.