Componentticket-stub1.06 KB gzipZero dependencies
Mailbox
Mailbox with flag raise and letter send animation.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add mailboxOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { Mailbox } from "@/components/ui/mailbox"; <Mailbox />Source code
mailbox.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxmailbox.tsx73 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface MailboxProps extends React.HTMLAttributes<HTMLDivElement> { recipient?: string; onSend?: () => void;} /** Mailbox: letter slides in + flag raises. */export function Mailbox({ recipient = "Ada Lovelace", onSend, className, ...props }: MailboxProps) { const [sent, setSent] = React.useState(false); const send = () => { setSent(true); onSend?.(); setTimeout(() => setSent(false), 3000);Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { Mailbox } from "@/components/ui/mailbox"; <Mailbox />| Prop | Type | Description |
|---|---|---|
| recipient | string | Configures recipient. (Default: "Ada Lovelace") |
| onSend | () => void | Callback invoked on send. |