Examples
Beam around a Card
Wrap an existing surface to draw a sweeping gradient ring along its edge.
Launch ready
Aura beam wrapping a Card
import { Aura } from "@phuctech/ui/components/aura";
import { Card, CardContent, CardHeader, CardTitle } from "@phuctech/ui/components/card";
export function Example() {
return (
<Aura coverage="three-quarter">
<Card>
<CardHeader>
<CardTitle>Launch ready</CardTitle>
</CardHeader>
<CardContent>A gradient beam sweeps the edge of the surface it wraps.</CardContent>
</Card>
</Aura>
);
}
Beam and glow
The same gradient can trace the edge as a beam or spread behind the surface as a glow.
Aura beam and glow effects side by side
import { Aura } from "@phuctech/ui/components/aura";
import { Card, CardContent } from "@phuctech/ui/components/card";
export function Example() {
return (
<div className="grid gap-8 sm:grid-cols-2">
<Aura effect="beam" palette="holo">
<Card>
<CardContent className="p-6 text-center font-medium">Beam</CardContent>
</Card>
</Aura>
<Aura effect="glow" palette="holo">
<Card>
<CardContent className="p-6 text-center font-medium">Glow</CardContent>
</Card>
</Aura>
</div>
);
}
Gradient palettes
Rainbow, holographic, gold, and silver recipes reuse the existing color tokens.
Aura gradient palette comparison
import { Aura, auraPaletteLabels, auraPalettes } from "@phuctech/ui/components/aura";
import { Card, CardContent } from "@phuctech/ui/components/card";
export function Example() {
return (
<div className="grid gap-6 sm:grid-cols-2">
{auraPalettes.map((palette) => (
<Aura key={palette} palette={palette} coverage="three-quarter">
<Card>
<CardContent className="p-6 text-center font-medium">
{auraPaletteLabels[palette]}
</CardContent>
</Card>
</Aura>
))}
</div>
);
}
Single color
Use one color family for a monochromatic gradient built from the shared hue tokens.
Aura single-color gradients
import { Aura } from "@phuctech/ui/components/aura";
import {
colorPaletteLabels,
colorPalettes,
type ColorPalette,
} from "@phuctech/ui/color-palette";
import { Card, CardContent } from "@phuctech/ui/components/card";
const hues = colorPalettes.filter((color): color is Exclude<ColorPalette, "neutral"> => color !== "neutral");
export function Example() {
return (
<div className="grid gap-6 sm:grid-cols-3">
{hues.map((color) => (
<Aura key={color} color={color} coverage="three-quarter">
<Card>
<CardContent className="p-6 text-center font-medium">
{colorPaletteLabels[color]}
</CardContent>
</Card>
</Aura>
))}
</div>
);
}
Beam coverage
Light the full ring, half of it, or a short travelling comet.
Aura beam coverage comparison
import { Aura, auraCoverageLabels, auraCoverages } from "@phuctech/ui/components/aura";
import { Card, CardContent } from "@phuctech/ui/components/card";
export function Example() {
return (
<div className="grid gap-6 sm:grid-cols-3">
{auraCoverages.map((coverage) => (
<Aura key={coverage} coverage={coverage}>
<Card>
<CardContent className="p-6 text-center font-medium">
{auraCoverageLabels[coverage]}
</CardContent>
</Card>
</Aura>
))}
</div>
);
}
Sweep speed
Slow, normal, and fast pacing for the travelling beam.
Aura sweep speed comparison
import { Aura, auraSpeedLabels, auraSpeeds } from "@phuctech/ui/components/aura";
import { Card, CardContent } from "@phuctech/ui/components/card";
export function Example() {
return (
<div className="grid gap-6 sm:grid-cols-3">
{auraSpeeds.map((speed) => (
<Aura key={speed} coverage="comet" speed={speed}>
<Card>
<CardContent className="p-6 text-center font-medium">
{auraSpeedLabels[speed]}
</CardContent>
</Card>
</Aura>
))}
</div>
);
}
Static gradient
Turn off the sweep for a still frame; reduced-motion users always get this rendering.
Aura static gradient frame
import { Aura } from "@phuctech/ui/components/aura";
import { Card, CardContent } from "@phuctech/ui/components/card";
export function Example() {
return (
<Aura palette="gold" animated={false}>
<Card>
<CardContent className="p-6">A still gradient frame with no motion.</CardContent>
</Card>
</Aura>
);
}
Effect playground
Combine effect, palette, coverage, speed, radius, and motion on a large surface.
Aura playground preview
import { Aura } from "@phuctech/ui/components/aura";
import { Card, CardContent } from "@phuctech/ui/components/card";
export function Example() {
return (
<Aura coverage="comet">
<Card>
<CardContent className="p-8">Wrap any large surface.</CardContent>
</Card>
</Aura>
);
}When to use
Use Aura to add emphasis to a hero Card, a pricing tier, or a feature panel where a moving gradient helps the surface stand out. Aura is purely decorative: it wraps content and never adds behavior, so it is a poor fit for dense lists, form fields, or anything that already competes for attention.
Usage
import { Aura } from "@phuctech/ui/components/aura";
import { Card, CardContent, CardHeader, CardTitle } from "@phuctech/ui/components/card";
export function Example() {
return (
<Aura coverage="three-quarter">
<Card>
<CardHeader>
<CardTitle>Launch ready</CardTitle>
</CardHeader>
<CardContent>A gradient beam sweeps the edge of the surface it wraps.</CardContent>
</Card>
</Aura>
);
}
Aura wraps its children and renders one decorative layer marked aria-hidden and pointer-events: none, so it never blocks clicks or focus. Match the radius prop to the wrapped surface so the frame follows its corners.
Variants
API
Tokens
Accessibility
- The gradient layer is
aria-hiddenand non-interactive, so assistive technology only sees the wrapped content. - Motion respects
prefers-reduced-motion: the sweep stops and the gradient renders static. - Never rely on the aura to convey meaning or state; it is decoration only.
- Keep readable contrast on the wrapped surface; the frame sits at the edge and does not change the content background.
Do and don’t
Reserve Aura for one or two hero surfaces where the extra emphasis earns its motion.
Wrap many surfaces at once or use it on form fields, list rows, or dense tables.