Getting Started
Templates
Components
Special Effects
Animations
Text Animations
Backgrounds
An ordered dither that follows your theme, your brand colors and your pointer.
import { Dither } from "@/registry/magicui/dither"
export function DitherDemo() {
return (
<Dither
pattern="horizon"
color={["var(--dither-low)", "var(--dither-mid)", "var(--dither-high)"]}
className="bg-background flex h-[420px] w-full flex-col items-center justify-center gap-4 rounded-lg border px-4 pb-28 text-center select-none [--dither-high:#4c1d95] [--dither-low:#c4b5fd] [--dither-mid:#7c3aed] md:h-[500px] md:gap-6 md:px-6 md:pb-24 dark:[--dither-high:#ede9fe] dark:[--dither-low:#2e1065] dark:[--dither-mid:#8b5cf6]"
>
<h1 className="max-w-xl text-3xl font-semibold tracking-tighter text-balance sm:text-4xl md:text-6xl">
Light, rendered one dot at a time
</h1>
<p className="text-muted-foreground max-w-md text-sm text-balance md:text-base">
An ordered dither that follows your theme, your brand colors and your
pointer.
</p>
<div className="flex flex-wrap justify-center gap-2 md:gap-3">
<button
type="button"
className="bg-foreground text-background h-9 rounded-full px-4 text-sm font-medium whitespace-nowrap md:h-10 md:px-5"
>
Get started
</button>
<button
type="button"
className="bg-background/80 h-9 rounded-full border px-4 text-sm font-medium whitespace-nowrap backdrop-blur md:h-10 md:px-5"
>
Learn more
</button>
</div>
</Dither>
)
}
pnpm dlx shadcn@latest add @magicui/dither
import { Dither } from "@/components/ui/dither"<Dither className="h-96">
<h1>Your content</h1>
</Dither>| Prop | Type | Default | Description |
|---|---|---|---|
pattern | string | "horizon" | A light pattern (horizon, glow, aurora, waves, clouds) or a palette pattern (see Patterns) |
src | string | - | Image or video URL to dither instead. Remote files must allow CORS |
color | string | string[] | "currentColor" | A CSS color, or a [low, mid, high] ramp from dim to bright dots. Palette patterns ignore it |
palette | string[] | - | Override the colors of a palette pattern, from darkest to brightest. Any CSS color works |
matrix | 2 | 4 | 8 | - | Size of the Bayer matrix. Larger matrices give finer, smoother steps. Palette patterns pick their own |
dotSize | number | 1 | Size of one dot in CSS pixels. Palette patterns pick their own size unless you set it |
intensity | number | 0.75 | Brightness of the field |
speed | number | 1 | Animation speed. 0 holds a still frame |
fps | number | 30 | Maximum frames per second |
interactive | boolean | true | Brighten the dots under the pointer |
Twelve palette patterns ship with their own colors, Bayer matrix and dot size, so each one works with no other props. They suit dark surfaces. Pass palette to recolor one.
<Dither pattern="veil" className="h-96" />Hero.
Deploy anywhere
Push to main and watch every region go live in under a minute.
import { Dither } from "@/registry/magicui/dither"
export function DitherGruvboxDusk() {
return (
<Dither
pattern="gruvbox-dusk"
className="flex h-[26rem] w-full flex-col items-center justify-center rounded-xl border px-4 text-center text-[#ebdbb2] select-none md:h-[30rem]"
>
<div className="rounded-xl bg-[#1d2021]/80 px-6 py-6 backdrop-blur-sm md:px-10 md:py-8">
<p className="text-sm font-medium tracking-widest text-[#fabd2f] uppercase">
Deploy anywhere
</p>
<h2 className="mt-3 max-w-xl text-3xl font-semibold tracking-tight text-balance md:text-4xl">
Ship before the sun sets
</h2>
<p className="mx-auto mt-3 max-w-sm text-sm text-[#d5c4a1]">
Push to main and watch every region go live in under a minute.
</p>
<button
type="button"
className="mt-6 rounded-md bg-[#fabd2f] px-5 py-2.5 text-sm font-medium text-[#1d2021] transition-colors hover:bg-[#fe8019] focus-visible:ring-2 focus-visible:ring-[#fabd2f] focus-visible:ring-offset-2 focus-visible:ring-offset-[#1d2021] focus-visible:outline-none"
>
Start deploying
</button>
</div>
</Dither>
)
}
Stats card.
Your app runs close to every user, on every continent.
import { Dither } from "@/registry/magicui/dither"
const stats = [
{ label: "Regions", value: "34" },
{ label: "Uptime", value: "99.99%" },
{ label: "Latency", value: "12 ms" },
] as const
export function DitherNordOrbit() {
return (
<Dither
pattern="nord-orbit"
className="flex h-80 w-full max-w-xl flex-col justify-between rounded-xl border p-6 text-[#eceff4] select-none md:p-8"
>
<div>
<h3 className="text-2xl font-semibold tracking-tight">Global edge</h3>
<p className="mt-1 max-w-xs text-sm text-[#d8dee9]">
Your app runs close to every user, on every continent.
</p>
</div>
<dl className="grid grid-cols-3 gap-4">
{stats.map((stat) => (
<div key={stat.label}>
<dt className="text-xs tracking-wide text-[#d8dee9] uppercase">
{stat.label}
</dt>
<dd className="text-xl font-semibold tabular-nums">{stat.value}</dd>
</div>
))}
</dl>
</Dither>
)
}
Testimonial.
“We moved the whole company over a weekend. Monday felt like nothing had changed.”
import { Dither } from "@/registry/magicui/dither"
export function DitherKanagawaMoonrise() {
return (
<Dither
pattern="kanagawa-moonrise"
className="h-96 w-full max-w-2xl rounded-xl border p-6 text-[#dcd7ba] select-none md:p-10"
>
<figure className="max-w-sm">
<blockquote className="text-xl leading-snug font-medium text-balance md:text-2xl">
“We moved the whole company over a weekend. Monday felt like nothing
had changed.”
</blockquote>
<figcaption className="mt-4 text-sm text-[#c8c093]">
Mira Tanaka, Head of Platform
</figcaption>
</figure>
</Dither>
)
}
Announcement banner.
NewOrbit 2.0 is here with live cursors.
import { Dither } from "@/registry/magicui/dither"
export function DitherOrbit() {
return (
<Dither
pattern="orbit"
className="flex h-28 w-full items-center justify-center rounded-xl border px-4 text-center text-[#eceff4] select-none"
>
<p className="flex flex-wrap items-center justify-center gap-x-3 gap-y-1 text-sm md:text-base">
<span className="rounded-full bg-[#88c0d0] px-2.5 py-0.5 text-xs font-semibold text-[#2e3440]">
New
</span>
<span className="font-medium">
Orbit 2.0 is here with live cursors.
</span>
<button
type="button"
className="font-medium text-[#88c0d0] underline underline-offset-4 hover:text-[#8fbcbb] focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-[#88c0d0]"
>
Read the release notes
</button>
</p>
</Dither>
)
}
Upgrade card.
Pro plan
Build as many sites as you like with priority support.
import { Dither } from "@/registry/magicui/dither"
export function DitherMeridian() {
return (
<Dither
pattern="meridian"
className="flex h-72 w-72 flex-col rounded-xl border p-5 text-[#d3c6aa] select-none"
>
<p className="text-xs font-medium tracking-widest text-[#a7c080] uppercase">
Pro plan
</p>
<h3 className="mt-2 text-xl font-semibold tracking-tight text-[#e5dcc0]">
Unlock unlimited projects
</h3>
<p className="mt-1 text-sm text-[#9da9a0]">
Build as many sites as you like with priority support.
</p>
<button
type="button"
className="mt-auto self-start rounded-md bg-[#a7c080] px-4 py-2 text-sm font-medium text-[#272e33] transition-colors hover:bg-[#b8d08f] focus-visible:ring-2 focus-visible:ring-[#a7c080] focus-visible:ring-offset-2 focus-visible:ring-offset-[#272e33] focus-visible:outline-none"
>
Upgrade
</button>
</Dither>
)
}
Pricing card.
$19per month
import { Dither } from "@/registry/magicui/dither"
const perks = [
"Unlimited eclipses",
"Priority rendering",
"Team sharing",
] as const
export function DitherEclipseRose() {
return (
<Dither
pattern="eclipse-rose"
className="h-96 w-full max-w-sm rounded-xl border p-6 text-[#e0def4] select-none"
>
<h3 className="text-sm font-medium text-[#c4a7e7]">Studio</h3>
<p className="mt-2 flex items-baseline gap-1">
<span className="text-4xl font-semibold tracking-tight">$19</span>
<span className="text-sm text-[#908caa]">per month</span>
</p>
<ul className="mt-5 space-y-2 text-sm">
{perks.map((perk) => (
<li key={perk} className="flex items-center gap-2">
<span className="size-1.5 rounded-full bg-[#ebbcba]" />
{perk}
</li>
))}
</ul>
</Dither>
)
}
Landing header.
Trail maps and conditions for every ridge, updated every hour.
import { Dither } from "@/registry/magicui/dither"
const links = ["Routes", "Gear", "Journal"] as const
export function DitherRidgeline() {
return (
<Dither
pattern="ridgeline"
className="flex h-[26rem] w-full flex-col rounded-xl border text-[#d3c6aa] select-none"
>
<nav className="flex items-center justify-between px-6 py-4 text-sm">
<span className="font-semibold tracking-tight text-[#e5dcc0]">
Alpine
</span>
<div className="flex gap-5">
{links.map((link) => (
<button
key={link}
type="button"
className="hover:text-[#e5dcc0] focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-[#a7c080]"
>
{link}
</button>
))}
</div>
</nav>
<div className="px-6 pt-8 md:px-10">
<h2 className="max-w-md text-4xl font-semibold tracking-tight text-balance text-[#e5dcc0] md:text-5xl">
Find your line
</h2>
<p className="mt-3 max-w-sm text-sm text-[#9da9a0]">
Trail maps and conditions for every ridge, updated every hour.
</p>
</div>
</Dither>
)
}
404 page.
404
This page moved, or it never existed. Head back to a known trail.
import { Dither } from "@/registry/magicui/dither"
export function DitherContour() {
return (
<Dither
pattern="contour"
className="flex h-96 w-full flex-col items-center justify-center rounded-xl border px-6 text-center text-[#eceff4] select-none"
>
<p className="font-mono text-sm text-[#88c0d0]">404</p>
<h2 className="mt-2 text-3xl font-semibold tracking-tight md:text-4xl">
You are off the map
</h2>
<p className="mt-2 max-w-xs text-sm text-[#d8dee9]">
This page moved, or it never existed. Head back to a known trail.
</p>
<button
type="button"
className="mt-6 rounded-md border border-[#88c0d0] bg-[#2e3440]/90 px-4 py-2 text-sm font-medium text-[#88c0d0] transition-colors hover:bg-[#88c0d0] hover:text-[#2e3440] focus-visible:ring-2 focus-visible:ring-[#88c0d0] focus-visible:ring-offset-2 focus-visible:ring-offset-[#2e3440] focus-visible:outline-none"
>
Back to home
</button>
</Dither>
)
}
Event card.
Live music
Three nights under open sky, Wadi Rum, Jordan.
OCT14
import { Dither } from "@/registry/magicui/dither"
export function DitherDunes() {
return (
<Dither
pattern="dunes"
className="flex h-64 w-full max-w-2xl flex-col rounded-xl border p-6 text-[#e0def4] select-none md:p-8"
>
<div className="flex items-start justify-between gap-4">
<div>
<p className="text-xs font-medium tracking-widest text-[#c4a7e7] uppercase">
Live music
</p>
<h3 className="mt-1 text-2xl font-semibold tracking-tight md:text-3xl">
Dune Festival
</h3>
<p className="mt-1 text-sm text-[#e0def4]">
Three nights under open sky, Wadi Rum, Jordan.
</p>
</div>
<p className="shrink-0 rounded-md border border-[#6e6a86] px-3 py-1.5 text-center text-sm leading-tight">
<span className="block text-xs text-[#908caa]">OCT</span>
<span className="text-lg font-semibold">14</span>
</p>
</div>
</Dither>
)
}
Big stat.
Last 90 days
99.99%
Uptime across every region, with zero data loss.
import { Dither } from "@/registry/magicui/dither"
export function DitherEclipseNord() {
return (
<Dither
pattern="eclipse-nord"
className="flex h-96 w-full flex-col items-center pt-12 text-center text-[#eceff4] select-none md:pt-16"
>
<p className="text-sm text-[#88c0d0]">Last 90 days</p>
<p className="mt-2 text-6xl font-semibold tracking-tighter tabular-nums md:text-8xl">
99.99%
</p>
<p className="mt-2 text-sm text-[#d8dee9]">
Uptime across every region, with zero data loss.
</p>
</Dither>
)
}
Assistant prompt.
An assistant that reads your docs and answers in seconds.
import { Dither } from "@/registry/magicui/dither"
export function DitherOrb() {
return (
<Dither
pattern="orb"
className="flex h-80 w-full max-w-xl flex-col justify-between rounded-xl border p-6 text-[#ebdbb2] select-none"
>
<div className="max-w-[17rem] self-start rounded-lg bg-[#282828]/85 px-4 py-3 backdrop-blur-sm">
<h3 className="text-2xl font-semibold tracking-tight">Meet Orb</h3>
<p className="mt-1 text-sm text-[#d5c4a1]">
An assistant that reads your docs and answers in seconds.
</p>
</div>
<div className="flex max-w-xs items-center gap-2 rounded-lg border border-[#504945] bg-[#282828]/90 p-1.5 backdrop-blur">
<input
type="text"
aria-label="Ask Orb"
placeholder="Ask anything"
className="min-w-0 flex-1 bg-transparent px-2 py-1 text-sm text-[#ebdbb2] placeholder:text-[#a89984] focus-visible:outline-none"
/>
<button
type="button"
className="rounded-md bg-[#d79921] px-3 py-1.5 text-sm font-medium text-[#282828] hover:bg-[#fabd2f] focus-visible:ring-2 focus-visible:ring-[#d79921] focus-visible:outline-none"
>
Ask
</button>
</div>
</Dither>
)
}
Footer.
Veil
End-to-end encrypted, on every device you own.
import { Dither } from "@/registry/magicui/dither"
export function DitherVeil() {
return (
<Dither
pattern="veil"
className="mx-auto flex aspect-[4/5] w-full max-w-md flex-col rounded-xl border p-8 text-[#e0def4] select-none"
>
<p className="text-sm font-medium text-[#c4a7e7]">Veil</p>
<h3 className="mt-2 text-3xl font-semibold tracking-tight text-balance">
Private notes that stay yours.
</h3>
<p className="mt-3 text-sm text-[#908caa]">
End-to-end encrypted, on every device you own.
</p>
<button
type="button"
className="mt-6 w-fit rounded-full bg-[#e0def4] px-5 py-2 text-sm font-medium text-[#191724]"
>
Join the waitlist
</button>
</Dither>
)
}
horizonglowaurorawavescloudsimport { Dither } from "@/registry/magicui/dither"
const patterns = ["horizon", "glow", "aurora", "waves", "clouds"] as const
export function DitherPatternsDemo() {
return (
<div className="grid w-full grid-cols-2 gap-3 md:grid-cols-5">
{patterns.map((pattern) => (
<Dither
key={pattern}
pattern={pattern}
className="bg-background flex h-32 items-end rounded-lg border p-3 select-none last:col-span-2 md:h-40 md:last:col-span-1"
>
<code className="bg-background/80 rounded px-1.5 py-0.5 text-xs backdrop-blur">
{pattern}
</code>
</Dither>
))}
</div>
)
}
Every branch gets a URL the moment you push.
Static assets served from 300 cities.
Go back to any deploy in one click.
import { Dither } from "@/registry/magicui/dither"
const cards = [
{
pattern: "glow",
title: "Live previews",
body: "Every branch gets a URL the moment you push.",
className: "md:col-span-2",
},
{
pattern: "clouds",
title: "Edge cache",
body: "Static assets served from 300 cities.",
className: "",
},
{
pattern: "waves",
title: "Instant rollbacks",
body: "Go back to any deploy in one click.",
className: "md:col-span-3",
},
] as const
export function DitherCardDemo() {
return (
<div className="grid w-full max-w-3xl gap-4 md:grid-cols-3">
{cards.map((card) => (
<Dither
key={card.title}
pattern={card.pattern}
color="var(--muted-foreground)"
intensity={0.6}
className={`bg-card flex h-44 flex-col justify-end rounded-xl border p-5 select-none md:h-56 md:p-6 ${card.className}`}
>
{/* Fades the dots out behind the text so it stays readable. */}
<div className="from-card absolute inset-x-0 bottom-0 h-2/3 bg-linear-to-t to-transparent" />
<h3 className="relative text-lg font-semibold tracking-tight">
{card.title}
</h3>
<p className="text-muted-foreground relative text-sm">{card.body}</p>
</Dither>
))}
</div>
)
}
import { Dither } from "@/registry/magicui/dither"
export function DitherTextDemo() {
return (
<Dither
pattern="clouds"
color={["var(--dither-low)", "var(--dither-mid)", "var(--dither-high)"]}
intensity={1.1}
className="h-64 w-full rounded-lg border bg-white [--dither-high:#164e63] [--dither-low:#67e8f9] [--dither-mid:#0891b2] md:h-[400px] dark:bg-black dark:[--dither-high:#ecfeff] dark:[--dither-low:#0e7490] dark:[--dither-mid:#22d3ee]"
>
{/* The overlay hides the dots everywhere except inside the letters. */}
<div className="absolute inset-0 flex items-center justify-center bg-white mix-blend-screen select-none dark:bg-black dark:mix-blend-multiply">
<span className="text-7xl leading-none font-black tracking-tighter text-black sm:text-9xl dark:text-white">
Dither
</span>
</div>
</Dither>
)
}
import { Dither } from "@/registry/magicui/dither"
export function DitherImageDemo() {
return (
<Dither
src="https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?q=80&w=1600&auto=format&fit=crop"
color={["#7c2d12", "#fb923c", "#fff7ed"]}
dotSize={2}
intensity={0.8}
className="h-72 w-full rounded-lg border bg-black md:h-[500px]"
/>
)
}
Ink on paper
Chalk on slate
Sodium
Glacier
import {
Dither,
type DitherColor,
type DitherPattern,
} from "@/registry/magicui/dither"
const tiles: {
label: string
pattern: DitherPattern
color: DitherColor
intensity?: number
className: string
}[] = [
{
label: "Ink on paper",
pattern: "horizon",
color: "#0a0a0a",
className: "bg-white text-neutral-950",
},
{
label: "Chalk on slate",
pattern: "horizon",
color: "#fafafa",
className: "bg-neutral-950 text-white",
},
{
label: "Sodium",
pattern: "glow",
color: ["#78350f", "#f59e0b", "#fef3c7"],
className: "bg-[#140b02] text-amber-50",
},
{
label: "Glacier",
pattern: "aurora",
color: ["#164e63", "#06b6d4", "#cffafe"],
intensity: 1.1,
className: "bg-[#020f14] text-cyan-50",
},
]
export function DitherColorsDemo() {
return (
<div className="grid w-full grid-cols-2 gap-3 md:grid-cols-4 md:gap-4">
{tiles.map((tile) => (
<Dither
key={tile.label}
pattern={tile.pattern}
color={tile.color}
intensity={tile.intensity}
className={`flex h-48 items-start rounded-xl border p-4 select-none md:h-64 ${tile.className}`}
>
<p className="text-sm font-medium">{tile.label}</p>
</Dither>
))}
</div>
)
}
On This Page
InstallationUsagePropsPatternsgruvbox-dusknord-orbitkanagawa-moonriseorbitmeridianeclipse-roseridgelinecontourduneseclipse-nordorbveilExamplesBuilt-in patternsCard BackgroundText MaskImageColorsShip Faster with Magic UI ProMagic UI Pro
Stop building from scratch.
Get 8 production-ready templates and 50+ premium components that your users will love.