Amount Input
manifest-ui/amount-inputFreeBlock
Amount input with increment/decrement buttons and preset values.
Install it
npx shadcn@latest add https://ui.manifest.build/r/amount-input.jsonSource
1"use client"23import { useState, useRef, useEffect, useMemo } from "react"4import { Button } from "@/components/ui/button"5import { Minus, Plus } from "lucide-react"6import { cn } from "@/lib/utils"7import { demoAmountPresets } from "./demo/payment"89/**10 * ═══════════════════════════════════════════════════════════════════════════11 * AmountInputProps12 * ═══════════════════════════════════════════════════════════════════════════13 *14 * Props for an amount input with increment/decrement buttons and preset values.15 * Supports direct text editing by clicking on the amount.16 */17export interface AmountInputProps {18 data?: {19 /** Quick-select preset amounts displayed as buttons. */20 presets?: number[]21 }22 actions?: {23 /** Called when user confirms the selected amount. */24 onConfirm?: (value: number) => void25 }26 appearance?: {27 /**28 * Minimum allowed value.29 * @default 030 */31 min?: number32 /**33 * Maximum allowed value.34 * @default 1000035 */36 max?: number37 /**38 * Increment/decrement step size for the +/- buttons.39 * @default 1040 */41 step?: number42 /**43 * Currency code for formatting the amount display.44 * @default "EUR"45 */46 currency?: string47 /**48 * Label text displayed above the input.49 * @default "Amount"50 */51 label?: string52 }53 control?: {54 /**55 * Controlled value for the amount input.56 * @default 5057 */58 value?: number59 }60}6162/**63 * An amount input with increment/decrement buttons and preset values.64 * Supports direct text editing by clicking on the amount.65 *66 * Features:67 * - Large centered amount display68 * - Plus/minus increment buttons69 * - Preset amount quick-select buttons70 * - Click-to-edit direct input71 * - Min/max value clamping72 * - Configurable step size73 * - Optional confirm button74 *75 * @component76 * @example77 * ```tsx78 * <AmountInput79 * data={{ presets: [25, 50, 100, 250] }}80 * actions={{81 * onChange: (value) => console.log("Amount changed:", value),82 * onConfirm: (value) => console.log("Confirmed:", value)83 * }}84 * appearance={{85 * min: 10,86 * max: 500,87 * step: 5,88 * currency: "USD",89// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from Manifest UI
All 32 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Chat Conversationchat-conversation | Manifest UI | Blocks | Free | 1 dep · 3 files | |
| Contact Formcontact-form | Manifest UI | Blocks | Free | 1 dep · 3 files | |
| Date & Time Pickerdate-time-picker | Manifest UI | Blocks | Free | 1 dep · 2 files | |
| Event Cardevent-card | Manifest UI | Blocks | Free | 1 dep · 2 files | |
| Event Confirmationevent-confirmation | Manifest UI | Blocks | Free | 1 dep · 2 files | |
| Event Detailevent-detail | Manifest UI | Blocks | Free | 3 deps · 2 files | |
| Event Listevent-list | Manifest UI | Blocks | Free | 3 deps · 2 files | |
| Herohero | Manifest UI | Blocks | Free | 1 dep · 2 files |
