Componentdata0.44 KB gzipZero dependencies
CurrencyDisplay
Formatted money with symbol, mono integer part, smaller muted decimals, optional count-up animation
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add currency-displayOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { CurrencyDisplay } from "@/components/ui/currency-display" <CurrencyDisplay amount={1234.56} currency="USD" animated />Source code
currency-display.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxcurrency-display.tsx47 lines
import * as React from "react";import { cn } from "./lib/utils"; export type CurrencyDisplayProps = { amount: number; currency?: string; locale?: string; animated?: boolean;}; const CurrencyDisplay = ({ amount, currency = "USD", locale = "en-US", animated = true,}: CurrencyDisplayProps) => { const formatted = new Intl.NumberFormat(locale, { style: "currency",Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { CurrencyDisplay } from "@/components/ui/currency-display"; <CurrencyDisplay />| Prop | Type | Description |
|---|---|---|
| amount | number | The monetary amount to display |
| currency | string | Currency code (e.g. USD, EUR) |
| locale | string | Locale format string |
| animated | boolean | Whether to animate on mount/change |