Side Glow
Soft blue edge glow anchored to one side of a positioned parent: top, right, bottom or left. Comes with SeamLine, a one-pixel overlay-blended rule for marking a panel edge.
pnpm dlx shadcn add @01orbital/side-glow"use client"
import { useId } from "react"
import { cn } from "cn"
const EDGE = {
right: {
cx: "100%",
cy: "50%",
className: "top-[-40%] -right-40 h-[180%] w-7xl",
},
left: {
cx: "0%",
cy: "50%",
className: "top-[-40%] -left-40 h-[180%] w-7xl",
},
bottom: {
cx: "50%",
cy: "100%",
className: "-bottom-40 left-[-40%] h-320 w-[180%]",
},
top: {
cx: "50%",
cy: "0%",
className: "-top-40 left-[-40%] h-320 w-[180%]",
},
} as const
/**
* A soft blue glow that comes in from one edge of a section, for the
* background behind its content. Put it inside a positioned parent: it fills
* that parent, clips itself to it, ignores the pointer and is hidden from
* assistive tech.
*/
function SideGlow({
edge = "right",
className,
...props
}: React.ComponentProps<"div"> & {
/** The edge the glow comes in from. Defaults to "right". */
edge?: keyof typeof EDGE
}) {
// An id passed in names the root; the gradient keeps its own.
const gradientId = `side-glow-${useId().replace(/[^\w-]/g, "")}`
const anchor = EDGE[edge]
return (
<div
aria-hidden="true"
data-slot="side-glow"
className={cn(
"pointer-events-none absolute inset-0 overflow-hidden",
className
)}
{...props}
>
<svg
className={cn("absolute", anchor.className)}
preserveAspectRatio="none"
>
<defs>
<radialGradient id={gradientId} cx={anchor.cx} cy={anchor.cy}>
<stop offset="0%" stopColor="oklch(0.754 0.139 233 / 0.3)" />
<stop offset="53.95%" stopColor="oklch(0.511 0.274 264 / 0.09)" />
<stop offset="100%" stopColor="oklch(0.164 0.02 266 / 0)" />
</radialGradient>
</defs>
<rect width="100%" height="100%" fill={`url(#${gradientId})`} />
</svg>
</div>
)
}
/**
* A one-pixel vertical line of white, blended in overlay mode so it lightens
* the surface under it. It is decorative and hidden from assistive tech.
*
* It is absolutely positioned with no height of its own: place it with
* `className`, for example `inset-y-0 right-0`.
*/
function SeamLine({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
aria-hidden="true"
data-slot="seam-line"
className={cn(
"pointer-events-none absolute w-px bg-[oklch(1_0_0)] mix-blend-overlay",
className
)}
{...props}
/>
)
}
export { SideGlow, SeamLine }
import { SeamLine, SideGlow } from "@/components/glow/side-glow"
// The glow and its seam on one edge of a panel.
export default function SideGlowDemo() {
return (
<div className="dark relative isolate grid min-h-full w-full flex-1 place-items-center overflow-hidden bg-background text-foreground">
<div className="relative isolate h-72 w-full max-w-md">
<SideGlow edge="right" />
<SeamLine className="inset-y-0 right-0" />
</div>
</div>
)
}
Usage
import { SeamLine, SideGlow } from "@/components/glow/side-glow"
// The glow and its seam on one edge of a panel.
export default function SideGlowDemo() {
return (
<div className="dark relative isolate grid min-h-full w-full flex-1 place-items-center overflow-hidden bg-background text-foreground">
<div className="relative isolate h-72 w-full max-w-md">
<SideGlow edge="right" />
<SeamLine className="inset-y-0 right-0" />
</div>
</div>
)
}Examples
Rail Ticketside-glow-rail-ticket
Train ticket example showing SideGlow: a mobile ticket lit along its top edge, with the journey above a dashed tear line and the seat details below.
pnpm dlx shadcn add @01orbital/side-glow-rail-ticketimport { Eyebrow } from "@/components/eyebrow/eyebrow"
import { SideGlow } from "@/components/glow/side-glow"
import {
Stat,
StatGroup,
StatLabel,
StatValue,
} from "@/components/stats/stats"
import { Card, CardContent, CardHeader } from "@/components/ui/card"
import {
Collapsible,
CollapsibleContent,
CollapsibleTrigger,
} from "@/components/ui/collapsible"
// The copy: change text here, not in the markup.
const COPY = {
label: "Blue Mile rail journey",
line: "Blue Mile",
ticketType: "Ticket · 1 adult",
date: "Wednesday, November 4",
origin: "Portland",
destination: "Seattle",
route: "Cascades 502 · Direct · 3h 35m",
summary: "Baggage & boarding",
boarding:
"Bring photo ID. Two carry-on bags are included. The platform is posted at Union Station 20 minutes before departure.",
departs: "08:12",
arrives: "11:47",
} as const
const DETAILS = [
{ term: "Coach", detail: "04" },
{ term: "Seat", detail: "18A" },
{ term: "Board by", detail: "08:02" },
] as const
/** A mobile train ticket lit by a SideGlow along its top edge, with the journey above a dashed tear line and the seat details below. */
export default function SideGlowRailTicket() {
return (
<Card
aria-label={COPY.label}
className="relative isolate mx-auto w-full max-w-sm rounded-2xl bg-[oklch(0.19_0.045_250)] text-[oklch(0.96_0.01_235)] shadow-none ring-0"
>
<SideGlow edge="top" />
<CardHeader className="relative flex items-center justify-between gap-3 text-xs">
<Eyebrow variant="caps" tone="ink" render={<span />}>
{COPY.line}
</Eyebrow>
<span>{COPY.ticketType}</span>
</CardHeader>
<CardContent className="relative flex flex-col gap-3">
<p className="text-sm text-[oklch(0.8_0.035_235)]">{COPY.date}</p>
<div className="grid grid-cols-[1fr_auto_1fr] items-center gap-3">
<div>
<p className="text-3xl font-semibold tabular-nums">
{COPY.departs}
</p>
<p className="mt-2 text-sm">{COPY.origin}</p>
</div>
<span
aria-hidden="true"
className="text-xl text-[oklch(0.8_0.065_235)]"
>
→
</span>
<div className="text-right">
<p className="text-3xl font-semibold tabular-nums">
{COPY.arrives}
</p>
<p className="mt-2 text-sm">{COPY.destination}</p>
</div>
</div>
<p className="mt-2 text-xs text-[oklch(0.8_0.035_235)]">{COPY.route}</p>
</CardContent>
<div className="relative -mb-(--card-spacing) border-t border-dashed border-[oklch(0.47_0.06_240)] bg-[oklch(0.23_0.045_250)] p-(--card-spacing)">
<StatGroup cols={3} gap="sm" className="grid-cols-3">
{DETAILS.map((item) => (
<Stat key={item.term} className="gap-1">
<StatLabel className="text-sm/5 text-[oklch(0.8_0.035_235)]">
{item.term}
</StatLabel>
<StatValue className="text-xl/7">{item.detail}</StatValue>
</Stat>
))}
</StatGroup>
<Collapsible className="mt-6 text-xs leading-6">
<CollapsibleTrigger className="cursor-pointer py-1 text-left focus-visible:outline-2 focus-visible:outline-offset-4">
{COPY.summary}
</CollapsibleTrigger>
<CollapsibleContent>
<p className="mt-2">{COPY.boarding}</p>
</CollapsibleContent>
</Collapsible>
</div>
</Card>
)
}
import { mergeProps } from "@base-ui/react/merge-props"
import { useRender } from "@base-ui/react/use-render"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "cn"
// default is a quiet 14px line, cased as written; icon puts a 16px icon in
// front of it; mono is a 12px uppercase mono label for spec-sheet designs;
// caps is the same size in a sans face. tone picks the ink: muted (the
// default) or the surrounding text color, for a label over art or on a dark
// island where muted-foreground is too quiet.
const eyebrowVariants = cva("", {
variants: {
/**
* The label style. `default` (the default) is a 14px line at weight 500,
* cased as written. `icon` is the same line with a 16px icon, placed
* first among the children, 12px before the words. `mono` is a 12px
* uppercase mono label at weight 500 with 0.12em letter spacing. `caps`
* is the same label in the sans face, for a brand and series label such
* as "Studio Neri / Clay school". The color comes from `tone`.
*/
variant: {
default: "text-sm/5 font-medium",
icon: "flex items-center gap-3 text-sm/5 font-medium [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
mono: "font-mono text-xs/5 font-medium tracking-[0.12em] uppercase",
caps: "text-xs/5 font-medium tracking-[0.12em] uppercase",
},
/**
* The ink. `muted` (the default) is `muted-foreground`. `ink` leaves the
* color to the surrounding text, for a label over art, on a dark island
* or anywhere the muted grey is too quiet to read.
*/
tone: {
muted: "text-muted-foreground",
ink: "",
},
},
defaultVariants: { variant: "default", tone: "muted" },
})
/**
* A short label set above a heading, such as a section name, rendered as a
* `<p>`. Leave 8px between it and the heading. Pass `render` to use another
* element.
*
* `default` is a 14px line at weight 500, cased as written. `icon` adds a
* 16px icon before the words: put the icon first, with `aria-hidden`. `mono`
* is a 12px uppercase mono label with 0.12em letter spacing; `caps` the same
* in the sans face, for a brand and series name such as "Studio Neri / Clay
* school". `tone="muted"` (the default) sets it in `muted-foreground`;
* `tone="ink"` takes the surrounding text color, for a label over art or on
* a dark island where the grey is too quiet.
*/
function Eyebrow({
className,
variant = "default",
tone = "muted",
render,
...props
}: useRender.ComponentProps<"p"> & VariantProps<typeof eyebrowVariants>) {
return useRender({
defaultTagName: "p",
render,
state: { slot: "eyebrow", variant, tone },
props: mergeProps<"p">(
{ className: cn(eyebrowVariants({ variant, tone }), className) },
props
),
})
}
export { Eyebrow, eyebrowVariants }
"use client"
import { useId } from "react"
import { cn } from "cn"
const EDGE = {
right: {
cx: "100%",
cy: "50%",
className: "top-[-40%] -right-40 h-[180%] w-7xl",
},
left: {
cx: "0%",
cy: "50%",
className: "top-[-40%] -left-40 h-[180%] w-7xl",
},
bottom: {
cx: "50%",
cy: "100%",
className: "-bottom-40 left-[-40%] h-320 w-[180%]",
},
top: {
cx: "50%",
cy: "0%",
className: "-top-40 left-[-40%] h-320 w-[180%]",
},
} as const
/**
* A soft blue glow that comes in from one edge of a section, for the
* background behind its content. Put it inside a positioned parent: it fills
* that parent, clips itself to it, ignores the pointer and is hidden from
* assistive tech.
*/
function SideGlow({
edge = "right",
className,
...props
}: React.ComponentProps<"div"> & {
/** The edge the glow comes in from. Defaults to "right". */
edge?: keyof typeof EDGE
}) {
// An id passed in names the root; the gradient keeps its own.
const gradientId = `side-glow-${useId().replace(/[^\w-]/g, "")}`
const anchor = EDGE[edge]
return (
<div
aria-hidden="true"
data-slot="side-glow"
className={cn(
"pointer-events-none absolute inset-0 overflow-hidden",
className
)}
{...props}
>
<svg
className={cn("absolute", anchor.className)}
preserveAspectRatio="none"
>
<defs>
<radialGradient id={gradientId} cx={anchor.cx} cy={anchor.cy}>
<stop offset="0%" stopColor="oklch(0.754 0.139 233 / 0.3)" />
<stop offset="53.95%" stopColor="oklch(0.511 0.274 264 / 0.09)" />
<stop offset="100%" stopColor="oklch(0.164 0.02 266 / 0)" />
</radialGradient>
</defs>
<rect width="100%" height="100%" fill={`url(#${gradientId})`} />
</svg>
</div>
)
}
/**
* A one-pixel vertical line of white, blended in overlay mode so it lightens
* the surface under it. It is decorative and hidden from assistive tech.
*
* It is absolutely positioned with no height of its own: place it with
* `className`, for example `inset-y-0 right-0`.
*/
function SeamLine({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
aria-hidden="true"
data-slot="seam-line"
className={cn(
"pointer-events-none absolute w-px bg-[oklch(1_0_0)] mix-blend-overlay",
className
)}
{...props}
/>
)
}
export { SideGlow, SeamLine }
import type { ComponentProps } from "react"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "cn"
import { Grid, type GridProps } from "@/components/grid/grid"
/**
* A list of `Stat` items laid out by `Grid`, rendered as a `ul`. It defaults
* to 3 columns and the large gap. Like `Grid`, its columns follow the width
* it is given, so size its parent to narrow it. `className` lands on the
* list.
*/
function StatGroup({
cols = 3,
gap = "lg",
...props
}: ComponentProps<"ul"> & {
/**
* The most columns, 3 by default. They step up as the list's space
* widens, the way `Grid`'s do.
*/
cols?: GridProps["cols"]
/**
* Space between stats: `xs` 8px, `sm` 16px, `md` 24px, `lg` 40px, `xl` 64px, `px` 1px, `none` 0. `lg`
* is the default.
*/
gap?: GridProps["gap"]
}) {
return (
<Grid
data-slot="stat-group"
render={<ul role="list" />}
cols={cols}
gap={gap}
// Grid's props are typed for its default div; this group renders a list.
{...(props as Omit<GridProps, "cols" | "gap">)}
/>
)
}
// card sets the stat on a filled panel; rule sets a line down its left side.
const statVariants = cva("grid content-start gap-2", {
variants: {
/**
* The stat style. `default` (the default) adds nothing. `card` sets it
* on a `rounded-xl` panel with 32px padding, filled with `muted`, or
* with `card` and `card-foreground` text in dark mode. `rule` draws a
* 1px line in `border` down its left side, 24px from the text.
*/
variant: {
default: "",
card: "rounded-xl bg-muted p-8 dark:bg-card dark:text-card-foreground",
rule: "border-l border-border pl-6",
},
},
defaultVariants: { variant: "default" },
})
/**
* One figure and its label, as an `li` inside `StatGroup`. Holds a
* `StatValue` and a `StatLabel`, stacked with 8px gaps.
*
* `card` sets it on a filled, rounded panel with 32px padding. `rule` draws a
* line down its left side.
*/
function Stat({
className,
variant = "default",
...props
}: ComponentProps<"li"> & VariantProps<typeof statVariants>) {
return (
<li
data-slot="stat"
data-variant={variant}
className={cn(statVariants({ variant }), className)}
{...props}
/>
)
}
/** The figure itself, such as a number or a percentage, at 32px in the body font. */
function StatValue({ className, ...props }: ComponentProps<"p">) {
return (
<p
data-slot="stat-value"
className={cn("text-[2rem]/10 tracking-tight", className)}
{...props}
/>
)
}
/**
* The caption under the figure: what it measures, in a few words. Small
* muted text, 14px on a 20px line, so the number carries the weight. Longer
* explanation belongs in the section's lead or a note, not here.
*/
function StatLabel({ className, ...props }: ComponentProps<"p">) {
return (
<p
data-slot="stat-label"
className={cn("text-sm/5 text-pretty text-muted-foreground", className)}
{...props}
/>
)
}
export { StatGroup, Stat, StatValue, StatLabel }
import { mergeProps } from "@base-ui/react/merge-props"
import { useRender } from "@base-ui/react/use-render"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "cn"
const GRID_DEFAULTS = { cols: 3, gap: "lg" } as const
// Columns follow the screen, stepping at 40rem and 48rem (and 64rem for six). Gap sizes read the shared --gap-*
// values in globals.css. The grid fills its parent's width: without that, a
// grid given `mx-auto` or set inside a centering parent shrinks to fit its
// content, and a part built on it that is a container collapses to nothing.
const containerGridVariants = cva("grid w-full grid-cols-1", {
variants: {
/**
* The most columns. Below 40rem of screen width the grid is one
* column (two for `6`); it steps up at 40rem and 48rem: `2` is two
* columns from 40rem, `3` two then three, `4` two then four, `5` three
* then five, and `6` three, then four, then six from 64rem. The default
* is 3.
*/
cols: {
1: "",
2: "sm:grid-cols-2",
3: "sm:grid-cols-2 md:grid-cols-3",
4: "sm:grid-cols-2 md:grid-cols-4",
5: "sm:grid-cols-3 md:grid-cols-5",
6: "grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6",
},
/**
* Space between items: `xs` 8px, `sm` 16px, `md` 24px, `lg` 40px, `xl` 64px, `px` 1px, `none` 0. `lg`
* is the default. The sizes are the `--gap-*` values in globals.css.
*/
gap: {
xs: "gap-(--gap-xs)",
sm: "gap-(--gap-sm)",
md: "gap-(--gap-md)",
lg: "gap-(--gap-lg)",
xl: "gap-(--gap-xl)",
px: "gap-px",
none: "gap-0",
},
},
defaultVariants: GRID_DEFAULTS,
})
type GridState = { slot: "grid" } & VariantProps<typeof containerGridVariants>
type GridProps = useRender.ComponentProps<"div", GridState> &
VariantProps<typeof containerGridVariants>
// className, render and every other prop go to the grid. To narrow a Grid,
// pass a `max-w-*` class or size its parent.
function Grid({
className,
cols = GRID_DEFAULTS.cols,
gap = GRID_DEFAULTS.gap,
render,
...props
}: GridProps) {
const grid = useRender({
defaultTagName: "div",
render,
state: { slot: "grid", cols, gap },
props: mergeProps<"div">(
{ className: cn(containerGridVariants({ cols, gap }), className) },
props
),
})
return grid
}
export { Grid, type GridProps }
Install Commandside-glow-install-command
Getting-started card example showing SideGlow and SeamLine: a card lit along its left edge, with a copyable install command.
pnpm dlx shadcn add @01orbital/side-glow-install-command"use client"
import { Eyebrow } from "@/components/eyebrow/eyebrow"
import { SeamLine, SideGlow } from "@/components/glow/side-glow"
import { Button } from "@/components/ui/button"
// The copy: change text here, not in the markup.
const COPY = {
label: "Dockyard CLI installation",
eyebrow: "DOCKYARD CLI / 0.9.6",
title: "Run your first local stack.",
description:
"Start Postgres, Redis, and your app from one dockyard.yaml. Requires Node.js 22 or later.",
cta: "Copy command",
hint: "macOS, Linux, and Windows · No global install",
command: "npx @dockyard/cli init",
copied: "Command copied. Paste it into your terminal.",
unavailable:
"Copy is unavailable here. Select the command above to copy it manually.",
} as const
/** A getting-started card lit along its left edge by a SideGlow and SeamLine, with a copyable install command. */
export default function SideGlowInstallCommand() {
return (
<section
aria-label={COPY.label}
className="relative isolate w-full max-w-lg overflow-hidden rounded-lg border border-[oklch(0.34_0.02_250)] bg-[oklch(0.15_0.02_250)] text-[oklch(0.94_0.015_240)]"
>
<SideGlow edge="left" className="opacity-70" />
<SeamLine className="inset-y-8 left-0" />
<div className="relative p-7">
<Eyebrow variant="mono" className="text-[oklch(0.79_0.07_220)]">
{COPY.eyebrow}
</Eyebrow>
<h3 className="mt-5 text-2xl font-semibold tracking-tight">
{COPY.title}
</h3>
<p className="mt-3 max-w-sm text-sm leading-6 text-[oklch(0.75_0.025_240)]">
{COPY.description}
</p>
<div className="mt-7 flex flex-wrap items-center justify-between gap-4 rounded-md border border-[oklch(0.4_0.04_235)] bg-[oklch(0.12_0.015_250)] p-4">
<code className="text-sm break-all">{COPY.command}</code>
<Button
type="button"
variant="outline"
className="h-auto min-h-9 rounded border-[oklch(0.52_0.05_235)] bg-transparent px-3 text-xs font-normal hover:bg-[oklch(0.29_0.04_240)] hover:text-inherit dark:bg-transparent dark:hover:bg-[oklch(0.29_0.04_240)]"
onClick={async (event) => {
const status = event.currentTarget
.closest("section")
?.querySelector("output")
try {
await navigator.clipboard.writeText(COPY.command)
if (status) status.textContent = COPY.copied
} catch {
if (status) status.textContent = COPY.unavailable
}
}}
>
{COPY.cta}
</Button>
</div>
<output
aria-live="polite"
className="mt-4 block min-h-10 text-xs leading-5 text-[oklch(0.78_0.04_225)]"
>
{COPY.hint}
</output>
</div>
</section>
)
}
import { mergeProps } from "@base-ui/react/merge-props"
import { useRender } from "@base-ui/react/use-render"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "cn"
// default is a quiet 14px line, cased as written; icon puts a 16px icon in
// front of it; mono is a 12px uppercase mono label for spec-sheet designs;
// caps is the same size in a sans face. tone picks the ink: muted (the
// default) or the surrounding text color, for a label over art or on a dark
// island where muted-foreground is too quiet.
const eyebrowVariants = cva("", {
variants: {
/**
* The label style. `default` (the default) is a 14px line at weight 500,
* cased as written. `icon` is the same line with a 16px icon, placed
* first among the children, 12px before the words. `mono` is a 12px
* uppercase mono label at weight 500 with 0.12em letter spacing. `caps`
* is the same label in the sans face, for a brand and series label such
* as "Studio Neri / Clay school". The color comes from `tone`.
*/
variant: {
default: "text-sm/5 font-medium",
icon: "flex items-center gap-3 text-sm/5 font-medium [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
mono: "font-mono text-xs/5 font-medium tracking-[0.12em] uppercase",
caps: "text-xs/5 font-medium tracking-[0.12em] uppercase",
},
/**
* The ink. `muted` (the default) is `muted-foreground`. `ink` leaves the
* color to the surrounding text, for a label over art, on a dark island
* or anywhere the muted grey is too quiet to read.
*/
tone: {
muted: "text-muted-foreground",
ink: "",
},
},
defaultVariants: { variant: "default", tone: "muted" },
})
/**
* A short label set above a heading, such as a section name, rendered as a
* `<p>`. Leave 8px between it and the heading. Pass `render` to use another
* element.
*
* `default` is a 14px line at weight 500, cased as written. `icon` adds a
* 16px icon before the words: put the icon first, with `aria-hidden`. `mono`
* is a 12px uppercase mono label with 0.12em letter spacing; `caps` the same
* in the sans face, for a brand and series name such as "Studio Neri / Clay
* school". `tone="muted"` (the default) sets it in `muted-foreground`;
* `tone="ink"` takes the surrounding text color, for a label over art or on
* a dark island where the grey is too quiet.
*/
function Eyebrow({
className,
variant = "default",
tone = "muted",
render,
...props
}: useRender.ComponentProps<"p"> & VariantProps<typeof eyebrowVariants>) {
return useRender({
defaultTagName: "p",
render,
state: { slot: "eyebrow", variant, tone },
props: mergeProps<"p">(
{ className: cn(eyebrowVariants({ variant, tone }), className) },
props
),
})
}
export { Eyebrow, eyebrowVariants }
"use client"
import { useId } from "react"
import { cn } from "cn"
const EDGE = {
right: {
cx: "100%",
cy: "50%",
className: "top-[-40%] -right-40 h-[180%] w-7xl",
},
left: {
cx: "0%",
cy: "50%",
className: "top-[-40%] -left-40 h-[180%] w-7xl",
},
bottom: {
cx: "50%",
cy: "100%",
className: "-bottom-40 left-[-40%] h-320 w-[180%]",
},
top: {
cx: "50%",
cy: "0%",
className: "-top-40 left-[-40%] h-320 w-[180%]",
},
} as const
/**
* A soft blue glow that comes in from one edge of a section, for the
* background behind its content. Put it inside a positioned parent: it fills
* that parent, clips itself to it, ignores the pointer and is hidden from
* assistive tech.
*/
function SideGlow({
edge = "right",
className,
...props
}: React.ComponentProps<"div"> & {
/** The edge the glow comes in from. Defaults to "right". */
edge?: keyof typeof EDGE
}) {
// An id passed in names the root; the gradient keeps its own.
const gradientId = `side-glow-${useId().replace(/[^\w-]/g, "")}`
const anchor = EDGE[edge]
return (
<div
aria-hidden="true"
data-slot="side-glow"
className={cn(
"pointer-events-none absolute inset-0 overflow-hidden",
className
)}
{...props}
>
<svg
className={cn("absolute", anchor.className)}
preserveAspectRatio="none"
>
<defs>
<radialGradient id={gradientId} cx={anchor.cx} cy={anchor.cy}>
<stop offset="0%" stopColor="oklch(0.754 0.139 233 / 0.3)" />
<stop offset="53.95%" stopColor="oklch(0.511 0.274 264 / 0.09)" />
<stop offset="100%" stopColor="oklch(0.164 0.02 266 / 0)" />
</radialGradient>
</defs>
<rect width="100%" height="100%" fill={`url(#${gradientId})`} />
</svg>
</div>
)
}
/**
* A one-pixel vertical line of white, blended in overlay mode so it lightens
* the surface under it. It is decorative and hidden from assistive tech.
*
* It is absolutely positioned with no height of its own: place it with
* `className`, for example `inset-y-0 right-0`.
*/
function SeamLine({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
aria-hidden="true"
data-slot="seam-line"
className={cn(
"pointer-events-none absolute w-px bg-[oklch(1_0_0)] mix-blend-overlay",
className
)}
{...props}
/>
)
}
export { SideGlow, SeamLine }
Anatomy
Side Glow is built from 2 parts. In the example they nest like this:
SideGlow
SeamLineSideGlow: A soft blue glow that comes in from one edge of a section, for the background behind its content. Put it inside a positioned parent: it fills that parent, clips itself to it, ignores the pointer and is hidden from assistive tech.SeamLine: A one-pixel vertical line of white, blended in overlay mode so it lightens the surface under it. It is decorative and hidden from assistive tech.
API reference
SideGlow
A soft blue glow that comes in from one edge of a section, for the background behind its content. Put it inside a positioned parent: it fills that parent, clips itself to it, ignores the pointer and is hidden from assistive tech.
Prop
Type
It also accepts the HTML attributes of the element it renders.
SeamLine
A one-pixel vertical line of white, blended in overlay mode so it lightens the surface under it. It is decorative and hidden from assistive tech.
It is absolutely positioned with no height of its own: place it with className, for example inset-y-0 right-0.
It accepts the HTML attributes of the element it renders.
Dependencies
npm: cn. The CLI installs them for you. cn merges Tailwind class names, in place of clsx and tailwind-merge.