Componentmedia0.48 KB gzipZero dependencies
Figure
Framed media figure with double-frame surface and delayed figcaption fade-in.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add figureOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { Figure } from "@/components/ui/figure"; <Figure src="/stage.jpg" alt="Stage" caption="Main stage at dusk" />Source code
figure.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxfigure.tsx40 lines
import * as React from "react";import { cn } from "./lib/utils"; export interface FigureProps extends React.HTMLAttributes<HTMLElement> { src?: string; alt?: string; caption?: React.ReactNode; children?: React.ReactNode;} export function Figure({ src, alt = "", caption, children, className, ...props }: FigureProps) { return ( <figure className={cn( "rounded-lg border border-border bg-card p-1 outline-1 outline-dashed outline-offset-[-6px] animate-[fade-in-up_0.3s_ease-out_both] motion-reduce:animate-none", className )} {...props}Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { Figure } from "@/components/ui/figure"; <Figure />| Prop | Type | Description |
|---|---|---|
| src | string | Configures src. |
| alt | string | Configures alt. (Default: "") |
| caption | React.ReactNode | Configures caption. |
| children | React.ReactNode | Child elements rendered inside the component. |