kevingirelli

Number Input

Forms

About

A text input for numeric values with decrement/increment buttons, min/max/step clamping, and keyboard spinbutton support (arrow keys, Page Up/Down, Home/End).

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Number Input to your project and fits it to your theme.

Code

How Number Input is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import NumberInput from "@/components/ui/number-input";
import { useState } from "react";

export default function NumberInputDemo() {
  const [guests, setGuests] = useState<number | null>(2);

  return (
    <div className="flex w-full max-w-xs flex-col gap-2">
      <label htmlFor="guests" className="text-sm font-medium">
        Guests
      </label>
      <NumberInput
        id="guests"
        value={guests}
        onValueChange={setGuests}
        min={1}
        max={12}
        step={1}
      />
      <p className="text-muted-foreground text-xs">
        Arrow keys step by 1, Page Up / Page Down by 10, Home and End jump to 1
        and 12.
      </p>
    </div>
  );
}

Dependencies

More by kevingirelli

View all
  • Aurora

    Aurora

    50
  • Warp Gradient

    Warp Gradient

    48
  • QR Code

    QR Code

    45
  • FAQ Section

    FAQ Section

    44
  • Wave Text

    Wave Text

    37
  • Corner Frame

    Corner Frame

    35
  • Animated Border

    Animated Border

    32
  • Spotlight

    Spotlight

    23

More in Forms

View all
  • Premium Auth

    Premium Auth

    496
  • Login 2

    Login 2

    7
  • Authentication Card

    Authentication Card

    45
  • Login 1

    Login 1

    52
  • Form

    Form

    16
  • Contact Card

    Contact Card

    1K
  • Book A Demo 3

    Book A Demo 3

    83
  • Card Studio

    Card Studio

    41