Componentdata0.44 KB gzipZero dependencies

CurrencyDisplay

Formatted money with symbol, mono integer part, smaller muted decimals, optional count-up animation

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add currency-display

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { CurrencyDisplay } from "@/components/ui/currency-display" <CurrencyDisplay amount={1234.56} currency="USD" animated />

Source code

currency-display.tsx + 1 helper

Zero 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 />
PropTypeDescription
amountnumberThe monetary amount to display
currencystringCurrency code (e.g. USD, EUR)
localestringLocale format string
animatedbooleanWhether to animate on mount/change