107 Pro components and page blocks

Get Pro

Updated

Amount Pad

New

Preview

Customize

Decimals2
Max100000
Size64px

Installation

npx shadcn@latest add https://uibrik.com/r/amount-pad.json
Adds the files to components/uibrik/amount-pad and installs motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/amount-pad.

Usage

import { AmountPad } from "@/components/uibrik/amount-pad/amount-pad";​<AmountPad  currency="$"  decimals={2}  max={100000}  size={64}  defaultValue=""  label="Amount"  // value="…"  // onChange={(value, amount) => {}}  // autoFocus={false}/>

Props

AmountPad
currency
Type string
"$"
Text before the number.
decimals
Type number
2
Digits allowed after the decimal point. 0 turns the decimal point off.
max
Type number
100000
Largest amount. A digit past it bounces off and the limit shows.
size
Type number
64
Font size of the number before it shrinks to fit.
value / onChange
Type string / (value, amount) => void
–
Controlled amount as typed, e.g. "1250.5", with its number.
defaultValue
Type string
""
Amount on mount when uncontrolled.
autoFocus
Type boolean
false
Focus the field on mount.
label
Type string
"Amount"
Accessible name.
className
Type string
–
Classes for the wrapper.