Components
Numeric input with increase/decrease controls and keyboard arrow support, based on TextField so it inherits its variants and sizes. Works in controlled and uncontrolled modes, supports icons, and integrates with the FormControl utility for labels and status messages.
npx @21st-dev/cli add reshaped/reshaped-number-fieldLoading preview...
import { Reshaped } from "reshaped/bundle";
import NumberField from "@/components/ui/reshaped-number-field";
const HashIcon = () => (
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<line x1="4" y1="9" x2="20" y2="9" />
<line x1="4" y1="15" x2="20" y2="15" />
<line x1="10" y1="3" x2="8" y2="21" />
<line x1="16" y1="3" x2="14" y2="21" />
</svg>
);
export default function Demo() {
return (
<Reshaped theme="slate">
<div style={{ maxWidth: 320, width: "100%", margin: "0 auto", padding: 24 }}>
<NumberField
icon={<HashIcon />}
name="amount"
variant="faded"
defaultValue={5}
increaseAriaLabel="Increase value"
decreaseAriaLabel="Decrease value"
/>
</div>
</Reshaped>
);
}
Loading preview...
Loading preview...
Loading preview...