Componentmedia0.48 KB gzipZero dependencies

Figure

Framed media figure with double-frame surface and delayed figcaption fade-in.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

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

npx bigbullui add figure

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { Figure } from "@/components/ui/figure"; <Figure src="/stage.jpg" alt="Stage" caption="Main stage at dusk" />

Source code

figure.tsx + 1 helper

Zero 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 />
PropTypeDescription
srcstringConfigures src.
altstringConfigures alt. (Default: "")
captionReact.ReactNodeConfigures caption.
childrenReact.ReactNodeChild elements rendered inside the component.