Hero
Hero section on the Aurora background with a shimmering headline and two Buttons.
Design faster, ship something beautiful
Backgrounds, components and blocks you can drop into any React + Tailwind project. Free, open and built to be remixed.
Usage
Drop the file into your project, along with the shared files listed below, and import it.
import { Hero } from "@/registry/blocks/hero";
export function Example() {
return <Hero />;
}Install prerequisites
Every component here relies only on Tailwind and the cn helper from shadcn/ui.
npm i clsx tailwind-mergeAlso copy these files
Hero imports these files. Keep the same paths, or update the imports to match.
"use client";
import type { ComponentProps, CSSProperties } from "react";
import { cn } from "@/lib/utils";
/**
* Keyframes ship with the component so the file works on its own. React 19
* hoists a <style> with `href` + `precedence` into <head> once, however many
* instances render.
*/
const AURORA_CSS = `
@keyframes ds-aurora {
0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
33% { transform: translate(12%, 8%) scale(1.15) rotate(20deg); }
66% { transform: translate(-10%, 12%) scale(0.92) rotate(-15deg); }
}
.ds-aurora-orb { animation: ds-aurora 18s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .ds-aurora-orb { animation: none; } }
`;
export interface AuroraProps extends ComponentProps<"div"> {
/** How strong the glow is. */
intensity?: "subtle" | "vivid";
/** Show a faint grid on top of the glow. */
grid?: boolean;
/** Seconds for one full drift cycle. Lower is faster. */
speed?: number;
/**
* Softness of the glow (how far the haze reaches).
* Softness comes from gradient falloff + circular masks, not `filter: blur()`,
* which softens Chrome but turns into hard rotated discs in Edge.
*/
blur?: number;
colorA?: string;
colorB?: string;
colorC?: string;
}
/** Soft drifting aurora glow. Put any content inside it as children. */
export function Aurora({
className,
children,
intensity = "vivid",
grid = true,
speed = 18,
blur = 110,
colorA = "var(--ds-primary, oklch(0.57 0.22 285))",
colorB = "var(--ds-accent, oklch(0.66 0.13 205))",
colorC = "var(--ds-highlight, oklch(0.63 0.21 350))",
...props
}: AuroraProps) {
// Fully transparent well before the circle edge so rotation never shows a hard rim.
const fadeEnd = Math.min(70, Math.max(48, Math.round(42 + blur * 0.2)));
const orb = (color: string, delay: number): CSSProperties => ({
background: `radial-gradient(circle at 50% 50%, ${color} 0%, ${color} 8%, transparent ${fadeEnd}%)`,
animationDuration: `${speed}s`,
animationDelay: `${-speed * delay}s`,
});
return (
<div className={cn("relative isolate overflow-hidden bg-background", className)} {...props}>
<style href="ds-aurora" precedence="default">
{AURORA_CSS}
</style>
<div
aria-hidden
className={cn(
"pointer-events-none absolute inset-0 -z-10",
intensity === "subtle" ? "opacity-45" : "opacity-85"
)}
>
{/*
Circles (rounded-full), not rectangles. The animation rotates each
orb; a rotated rect shows hard corners in Edge. A circle stays soft
under rotation when the gradient fades out early.
*/}
<div
className="ds-aurora-orb absolute -top-[35%] -left-[30%] aspect-square w-[110%] rounded-full"
style={orb(colorA, 0)}
/>
<div
className="ds-aurora-orb absolute -top-[25%] -right-[35%] aspect-square w-[100%] rounded-full"
style={orb(colorB, 1 / 3)}
/>
<div
className="ds-aurora-orb absolute -bottom-[45%] left-[0%] aspect-square w-[105%] rounded-full"
style={orb(colorC, 2 / 3)}
/>
{grid && (
<div
className="absolute inset-0 mask-[radial-gradient(ellipse_at_center,black_30%,transparent_75%)] bg-size-[48px_48px]"
style={{
backgroundImage:
"linear-gradient(to right, color-mix(in oklab, var(--color-foreground) 7%, transparent) 1px, transparent 1px), linear-gradient(to bottom, color-mix(in oklab, var(--color-foreground) 7%, transparent) 1px, transparent 1px)",
}}
/>
)}
<div className="absolute inset-0 bg-[radial-gradient(ellipse_at_center,transparent_10%,var(--color-background)_82%)]" />
</div>
{children}
</div>
);
}
'use client'
import type { ComponentProps } from 'react'
import { cn } from '@/lib/utils'
const variants = {
primary:
'bg-ds-primary text-ds-primary-foreground shadow-[0_0_0_1px_rgb(255_255_255/0.12)_inset,0_8px_24px_-8px_var(--ds-primary)] hover:bg-ds-primary-hover',
secondary: 'border border-border bg-ds-surface text-foreground hover:bg-ds-surface-hover',
ghost: 'text-foreground hover:bg-ds-surface',
} as const
const sizes = {
sm: 'h-8 gap-1.5 rounded-sm px-3 text-xs',
md: 'h-10 gap-2 rounded-md px-4 text-sm',
lg: 'h-12 gap-2.5 rounded-lg px-6 text-base',
} as const
export interface ButtonProps extends ComponentProps<'button'> {
variant?: keyof typeof variants
size?: keyof typeof sizes
}
export function Button({ className, variant = 'primary', size = 'md', type = 'button', ...props }: ButtonProps) {
return (
<button
type={type}
className={cn(
'inline-flex shrink-0 cursor-pointer items-center justify-center font-medium whitespace-nowrap transition-all duration-150 select-none',
'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-none',
'active:scale-[0.97] disabled:pointer-events-none disabled:opacity-50',
variants[variant],
sizes[size],
className,
)}
{...props}
/>
)
}
More in Blocks
Bento Grid
A responsive bento layout that collapses to a single column on mobile, with per-card column and row spans and a hover glow that scales from the corner.
Timeline
A vertical timeline with a brand dot per milestone and a left rule — enough structure for changelogs, roadmaps and onboarding steps.
ASCII Footer
The brand set in monospace characters that shimmer in a slow wave and scramble under the cursor, or an ASCII sunset sea.