Components
Starting preview...
Number Input by NumberFlow
@barvian
npx shadcn@latest add https://21st.dev/r/barvian/number-inputimport { useState } from "react"
import { Input } from "@/components/ui/number-input"
function BasicExample() {
const [value, setValue] = useState(0)
return (
<div className="space-y-2">
<Input
value={value}
onChange={setValue}
/>
</div>
)
}
function WithMinMax() {
const [value, setValue] = useState(0)
return (
<div className="space-y-2">
<Input value={value} onChange={setValue} min={0} max={10} />
<p className="text-sm text-zinc-500">Min: 0, Max: 10</p>
</div>
);
}
export default {
BasicExample,
WithMinMax,
}