SL

Currency Input

Forms

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;

Dependencies

More by SL

View all
  • Playback Scrubber

    Playback Scrubber

    58
  • Matte Alert Feedback

    Matte Alert Feedback

    44
  • Notification Stack

    Notification Stack

    33
  • Time Window Slider

    Time Window Slider

    26
  • Matte Meter Slider

    Matte Meter Slider

    17
  • Commands Menu

    Commands Menu

    15
  • Matte Opacity Slider

    Matte Opacity Slider

    13
  • Undo Feedback

    Undo Feedback

    9

More in Forms

View all
  • Contact Card

    Contact Card

    1.1K
  • Premium Auth

    Premium Auth

    559
  • Book A Demo 1

    Book A Demo 1

    88
  • Form

    Form

    139
  • Authentication Card

    Authentication Card

    51
  • Book A Demo 3

    Book A Demo 3

    99
  • Login 2

    Login 2

    11
  • SignInPage

    SignInPage

    740