Media
Media frame for images and scenes with default, outline hairline, muted mat and placeholder variants and four corner radii. A direct img fills the frame and crops, and it renders as any element.
The source comes with full access.
One payment of $149 opens the source right here and lets the CLI install every paid component, with lifetime updates.
Installation
pnpm dlx shadcn@latest add @01orbital/medianpx shadcn@latest add @01orbital/mediayarn dlx shadcn@latest add @01orbital/mediabunx --bun shadcn@latest add @01orbital/mediaUsage
import { Media } from "@/components/media/media"
const COPY = {
image: "https://01orbital.dev/art/kit/layered-currents-553717.png",
alt: "Layered currents, a painting of scattered blue and coral dots",
matted: "https://01orbital.dev/art/kit/celestograph-61495-roan-6b.png",
mattedAlt: "A celestograph plate, taupe marbling veined with rust",
empty: "Image to come",
}
// Crop an image, mat another, hold a slot: the three jobs a frame does.
export default function MediaDemo() {
return (
<div className="grid w-full max-w-3xl gap-6 sm:grid-cols-3">
<Media variant="outline" radius="lg" className="aspect-4/5">
<img src={COPY.image} alt={COPY.alt} />
</Media>
<Media variant="muted" radius="lg" className="aspect-4/5">
<img src={COPY.matted} alt={COPY.mattedAlt} className="rounded-sm" />
</Media>
<Media variant="placeholder" radius="lg" className="aspect-4/5">
{COPY.empty}
</Media>
</div>
)
}This example installs with everything it uses:
pnpm dlx shadcn@latest add @01orbital/media-demonpx shadcn@latest add @01orbital/media-demoyarn dlx shadcn@latest add @01orbital/media-demobunx --bun shadcn@latest add @01orbital/media-demoExamples
Paper Mat Printmedia-paper-mat-print
Art print example showing Media: a square-cornered, wide paper mat framing a teal print.
The source comes with full access.
One payment of $149 opens the source right here and lets the CLI install every paid component, with lifetime updates.
pnpm dlx shadcn@latest add @01orbital/media-paper-mat-printnpx shadcn@latest add @01orbital/media-paper-mat-printyarn dlx shadcn@latest add @01orbital/media-paper-mat-printbunx --bun shadcn@latest add @01orbital/media-paper-mat-printBone Slab Covermedia-bone-slab-cover
Editorial cover example showing Media: a rounded frame containing bone-colored light slabs and a dark caption.
The source comes with full access.
One payment of $149 opens the source right here and lets the CLI install every paid component, with lifetime updates.
pnpm dlx shadcn@latest add @01orbital/media-bone-slab-covernpx shadcn@latest add @01orbital/media-bone-slab-coveryarn dlx shadcn@latest add @01orbital/media-bone-slab-coverbunx --bun shadcn@latest add @01orbital/media-bone-slab-coverAPI reference
A frame for an image, video or artwork in a block: it clips what is inside and rounds the corners. A direct <img> child fills the frame and is cropped to it; the frame is relative, so absolutely positioned art places itself against it.
default is bare, outline adds a faint hairline ring, muted mats the piece with 8px of muted background inside the ring, and placeholder is a muted empty slot with small centered text. radius sets the corners: none, sm (the default), md or lg. Set a ratio with an aspect-* class, or pass render={<AspectRatio ratio={…} />}.
Prop
Type
It also accepts the props of the Base UI part it wraps, and the HTML attributes of the element it renders.
Dependencies
npm: @base-ui/react, class-variance-authority, cn. The CLI installs them for you.
Used in blocks
11 blocks are built with Media:
About Story with Stats
Alternating Project Rows
Mega Menu Navbar
Navbar Hero with Art Tiles
Per-Member Pricing with Toggle
Portfolio Project Showcase
Split CTA with Limb Scene
Split Testimonial with Cover Art
Team Film Strip
Team with Color-Field Painting
Two-Plan Contact Sales Pricing
Last updated on