Get Started
Components
- Accordion
- Attachment
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Card
- Checkbox
- Code Block
- Collapsible
- Dialog
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Label
- Marker
- Message
- Number Flow
- Pagination
- Popover
- Progress
- Radio Group
- Select
- Slider
- Sonner
- Spinner
- Switch
- Tooltip
- Separator
- Sheet
- Tabs
- Textarea
- Toggle
- Toggle Group
- Trace
AI Elements
Libraries
Utilities
Adds a Credit Card module. Renders a card display with auto brand detection, auto number and expiry formatting, a masked mode for saved-card lists, and a glass variant for translucent surfaces.
Credit Card
4•2•4•2•  4•2•4•2•  4•2•4•2•  44224422
Card holder
John Doe
Expires
12/28
import { FrakmentMark } from "@/components/site/brand";
import {
CreditCard,
CreditCardBrand,
CreditCardExpiry,
CreditCardFooter,
CreditCardHeader,
CreditCardHolder,
CreditCardIssuer,
CreditCardNumber,
} from "@/components/ui/credit-card";
export function CreditCardDemo() {
return (
<CreditCard>
<CreditCardHeader>
<CreditCardIssuer
logo={<FrakmentMark className="size-5 sm:size-6" />}
/>
<CreditCardBrand brand="visa" />
</CreditCardHeader>
<CreditCardNumber value="4242424242424242" />
<CreditCardFooter>
<CreditCardHolder value="John Doe" />
<CreditCardExpiry value="1228" />
</CreditCardFooter>
</CreditCard>
);
}Installation
Install the module
$ bunx --bun frakment add credit-card$ npx frakment add credit-card$ pnpm dlx frakment add credit-card$ yarn dlx frakment add credit-card
Use it in your app
import { CreditCard } from "@/components/ui/credit-card";Minimal usage
<CreditCard
cardNumber="4242424242424242"
cardHolder="John Doe"
cardExpiration="1228"
/>Pass raw data - the component handles brand detection, number grouping, and expiry normalization. Use masked for saved-card lists and variant="glass" for surfaces over gradient or image backgrounds.
See the Credit Card docs for variants, brands, anatomy, and API.