About
A formatted text input for entering monetary amounts, with prefix/suffix, thousands grouping, decimal control, and an optional clear button.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Currency Input to your project and fits it to your theme.
Code
How Currency Input is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import { useState } from "react";
import { Label } from "@/components/ui/label";
import { CurrencyInput } from "@/components/ui/currency-input";
export function CurrencyInputDemo() {
const [monthlyPrice, setMonthlyPrice] = useState<string | undefined>("29.00");
return (
<div className="grid w-full max-w-md gap-6">
<div className="space-y-1">
<p className="font-medium text-sm">Billing settings</p>
<p className="text-muted-foreground text-sm">
Configure workspace pricing and account credits.
</p>
</div>
<div className="space-y-2">
<Label htmlFor="monthly-price">Monthly price</Label>
<CurrencyInput
decimalSeparator="."
decimalsLimit={2}
groupSeparator=","
id="monthly-price"
name="monthlyPrice"
onValueChange={(value) => setMonthlyPrice(value)}
placeholder="Enter monthly price"
prefix="$"
value={monthlyPrice}
/>
<p className="text-muted-foreground text-sm">
Charged once per workspace each month.
</p>
</div>
</div>
);
}
export default CurrencyInputDemo;
















