Route Cards
A split introduction with two linked route cards, one into the documentation and one into the collection, each marked by a glowing standing seam.
import type { CSSProperties } from "react"
import { cn } from "cn"
import { Eyebrow } from "@/components/eyebrow/eyebrow"
import { StandingSeam } from "@/components/glow/glow-seam"
import { Subheading } from "@/components/subheading/subheading"
import { Text } from "@/components/text/text"
import { buttonVariants } from "@/components/ui/button"
// The copy: change text here, not in the markup.
const COPY = {
link: "Open GlowSeam",
eyebrow: "Contact / route preview",
title: "Find the right starting point.",
description: "Choose a route into the collection or the documentation.",
} as const
const ROUTES = [
{
title: "Getting started",
body: "Installation notes and the component guide.",
action: "Read the documentation",
href: "#",
core: "oklch(0.32 0.07 235)",
edge: "oklch(0.45 0.09 230)",
bloom: "oklch(0.45 0.1 232 / 0.3)",
},
{
title: "Explore the pieces",
body: "Browse the collection and find a starting point.",
action: "Browse components",
href: "#",
core: "oklch(0.32 0.084 165)",
edge: "oklch(0.45 0.108 165 / 0.9)",
bloom: "oklch(0.45 0.12 165 / 0.28)",
},
] as const
/** A contact section on a light ground with an introduction on one side and two route cards on the other, each marked by a standing seam. */
export default function GlowSeamContactRoutes() {
return (
<div className="relative isolate flex min-h-[440px] w-full max-w-[1240px] min-w-0 flex-col gap-8 overflow-hidden rounded-[16px] bg-background p-10 text-foreground [--font-display:var(--font-serif)] max-[600px]:min-h-[400px] max-[600px]:rounded-[12px] max-[600px]:p-[28px_24px]">
<div className="grid min-w-0 grid-cols-2 items-center gap-12 max-[600px]:grid-cols-1 max-[600px]:gap-7">
<div className="min-w-0">
<header className="relative z-2 grid max-w-[650px] min-w-0 gap-6">
<Eyebrow variant="mono">{COPY.eyebrow}</Eyebrow>
<Subheading>{COPY.title}</Subheading>
<Text variant="muted" className="max-w-[500px]">
{COPY.description}
</Text>
</header>
<div className="relative z-2 mt-7 flex flex-wrap items-center gap-3">
<a
href="#"
className={cn(
buttonVariants({ variant: "outline", size: "lg" }),
"h-auto min-h-10 max-w-full py-2.5 text-center whitespace-normal"
)}
>
{COPY.link}
</a>
</div>
</div>
<div className="grid min-w-0 gap-[18px]">
{ROUTES.map((route) => (
<a
key={route.title}
href={route.href}
className="relative grid min-w-0 gap-2.5 rounded-[12px] border border-border bg-card p-[24px_24px_24px_32px] text-foreground no-underline hover:border-foreground focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-current max-[300px]:pr-[18px]"
>
<StandingSeam
className="top-3 bottom-3 left-3 w-3 [&>span:first-of-type]:w-[1.2px] [&>span:last-of-type]:mix-blend-normal"
style={
{
"--ss-core": route.core,
"--ss-edge": route.edge,
"--ss-bloom": route.bloom,
} as CSSProperties
}
/>
<h5 className="text-[18px]/[1.5] font-normal">{route.title}</h5>
<p className="text-[13px]/[1.8] text-muted-foreground">
{route.body}
</p>
<span className="mt-1.5 text-xs/[1.7] underline underline-offset-4">
{route.action}
</span>
</a>
))}
</div>
</div>
</div>
)
}
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 eyebrowVariants = cva("text-eyebrow", {
variants: {
/**
* `default` is a 14px/20px label. `icon` adds a row with a 16px icon
* and a 12px gap; put the icon first and give it `aria-hidden`.
* `mono` and `caps` are 12px/20px uppercase labels with 0.12em
* tracking, in the mono and inherited faces respectively.
*/
variant: {
default: "text-sm/5 font-medium text-eyebrow",
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",
},
},
defaultVariants: { variant: "default" },
})
/**
* A short label above a heading, rendered as a `<p>` at weight 500.
* The default is 14px/20px in the kit's eyebrow color. The surrounding
* layout controls the space to the heading. Use `className` to customize
* the typography or color, and `render` to change the element.
*/
function Eyebrow({
className,
variant = "default",
render,
...props
}: useRender.ComponentProps<"p"> & VariantProps<typeof eyebrowVariants>) {
return useRender({
defaultTagName: "p",
render,
state: { slot: "eyebrow", variant },
props: mergeProps<"p">(
{ className: cn(eyebrowVariants({ variant }), className) },
props
),
})
}
export { Eyebrow, eyebrowVariants }
import type * as React from "react"
import { cn } from "cn"
// Diegetic seams, two marks. GlowSeam is the horizontal section divider
// (rose); StandingSeam is the vertical line marking the active item (cool).
// Each follows its ground: a lit seam on dark, the same hue as ink on light.
/** One face of a seam: the bright line, its edges and the bloom around it. */
type SeamFace = { core: string; edge: string; bloom: string }
/**
* The named seam colors. Each has a `glow` face for dark grounds, a lit line
* at high lightness, and an `ink` face for light grounds, the same hue as a
* deeper ink. Rose is the Glow Seam's default and cyan the Standing Seam's.
*/
const SEAM_COLORS = {
rose: {
glow: {
core: "oklch(0.88 0.08 25)",
edge: "oklch(0.72 0.13 15 / 0.9)",
bloom: "oklch(0.68 0.14 20 / 0.55)",
},
ink: {
core: "oklch(0.3 0.1 20)",
edge: "oklch(0.45 0.13 15 / 0.9)",
bloom: "oklch(0.45 0.14 20 / 0.28)",
},
},
cyan: {
glow: {
core: "oklch(0.92 0.05 235)",
edge: "oklch(0.8 0.09 230)",
bloom: "oklch(0.7 0.1 232 / 0.55)",
},
ink: {
core: "oklch(0.32 0.07 235)",
edge: "oklch(0.45 0.09 230)",
bloom: "oklch(0.45 0.1 232 / 0.3)",
},
},
amber: {
glow: {
core: "oklch(0.91 0.063 78)",
edge: "oklch(0.77 0.14 78 / 0.9)",
bloom: "oklch(0.7 0.14 78 / 0.55)",
},
ink: {
core: "oklch(0.32 0.098 78)",
edge: "oklch(0.45 0.126 78 / 0.9)",
bloom: "oklch(0.45 0.14 78 / 0.28)",
},
},
coral: {
glow: {
core: "oklch(0.91 0.0675 36)",
edge: "oklch(0.77 0.15 36 / 0.9)",
bloom: "oklch(0.7 0.15 36 / 0.55)",
},
ink: {
core: "oklch(0.32 0.105 36)",
edge: "oklch(0.45 0.135 36 / 0.9)",
bloom: "oklch(0.45 0.15 36 / 0.28)",
},
},
ice: {
glow: {
core: "oklch(0.91 0.0405 255)",
edge: "oklch(0.77 0.09 255 / 0.9)",
bloom: "oklch(0.7 0.09 255 / 0.55)",
},
ink: {
core: "oklch(0.32 0.063 255)",
edge: "oklch(0.45 0.081 255 / 0.9)",
bloom: "oklch(0.45 0.09 255 / 0.28)",
},
},
violet: {
glow: {
core: "oklch(0.91 0.063 295)",
edge: "oklch(0.77 0.14 295 / 0.9)",
bloom: "oklch(0.7 0.14 295 / 0.55)",
},
ink: {
core: "oklch(0.32 0.098 295)",
edge: "oklch(0.45 0.126 295 / 0.9)",
bloom: "oklch(0.45 0.14 295 / 0.28)",
},
},
mint: {
glow: {
core: "oklch(0.91 0.054 165)",
edge: "oklch(0.77 0.12 165 / 0.9)",
bloom: "oklch(0.7 0.12 165 / 0.55)",
},
ink: {
core: "oklch(0.32 0.084 165)",
edge: "oklch(0.45 0.108 165 / 0.9)",
bloom: "oklch(0.45 0.12 165 / 0.28)",
},
},
pearl: {
glow: {
core: "oklch(0.91 0 0)",
edge: "oklch(0.77 0 0 / 0.9)",
bloom: "oklch(0.7 0 0 / 0.55)",
},
ink: {
core: "oklch(0.32 0 0)",
edge: "oklch(0.45 0 0 / 0.9)",
bloom: "oklch(0.45 0 0 / 0.28)",
},
},
} satisfies Record<string, { glow: SeamFace; ink: SeamFace }>
type SeamColor = keyof typeof SEAM_COLORS
/** `auto` follows the color scheme: ink in light, glow in dark. */
type SeamTone = "auto" | "glow" | "ink"
// The faces land in per-tone variables; the classes below pick one per
// scheme. For a color of your own, set `--gs-light-*` and `--gs-dark-*`
// inline, or set `--gs-core`, `--gs-edge` and `--gs-bloom` inline to force
// one face in both schemes.
function seamVars(prefix: "gs" | "ss", color: SeamColor, tone: SeamTone) {
const c = SEAM_COLORS[color]
const light = tone === "glow" ? c.glow : c.ink
const dark = tone === "ink" ? c.ink : c.glow
return {
[`--${prefix}-light-core`]: light.core,
[`--${prefix}-light-edge`]: light.edge,
[`--${prefix}-light-bloom`]: light.bloom,
[`--${prefix}-dark-core`]: dark.core,
[`--${prefix}-dark-edge`]: dark.edge,
[`--${prefix}-dark-bloom`]: dark.bloom,
} as React.CSSProperties
}
/**
* A thin horizontal divider between sections: a rose line, brightest in the
* middle and fading out at both ends, with a soft blurred bloom around it.
* In dark mode it glows; in light mode it is a deeper rose ink.
*
* It is decorative, hidden from assistive tech, and spans the width of its
* container.
*/
function GlowSeam({
color = "rose",
tone = "auto",
className,
style,
...props
}: React.ComponentProps<"div"> & {
/** The named color; `rose` by default. See `SEAM_COLORS`. */
color?: SeamColor
/** `auto` follows the scheme; `glow` or `ink` forces one face. */
tone?: SeamTone
}) {
return (
<div
aria-hidden="true"
data-slot="glow-seam"
data-color={color}
className={cn(
"pointer-events-none relative h-0.5",
"[--gs-bloom:var(--gs-light-bloom)] [--gs-core:var(--gs-light-core)] [--gs-edge:var(--gs-light-edge)]",
"dark:[--gs-bloom:var(--gs-dark-bloom)] dark:[--gs-core:var(--gs-dark-core)] dark:[--gs-edge:var(--gs-dark-edge)]",
className
)}
style={{ ...seamVars("gs", color, tone), ...style }}
{...props}
>
<div
className="absolute inset-x-[6%] top-0 h-[1.5px]"
style={{
background:
"linear-gradient(90deg, transparent, var(--gs-edge) 38%, var(--gs-core) 52%, var(--gs-edge) 66%, transparent)",
}}
/>
<div
className="absolute inset-x-[12%] -top-1.75 h-3.75 blur-[9px] dark:mix-blend-screen"
style={{
background:
"radial-gradient(50% 100% at 50% 50%, var(--gs-bloom), transparent 75%)",
}}
/>
</div>
)
}
/**
* A vertical line of cool blue light that marks the active item, such as the
* selected tab. Like `GlowSeam`, it glows in dark mode and is a deeper ink in
* light mode. It is decorative and hidden from assistive tech.
*
* It is absolutely positioned with no size of its own: place it with
* `className`, for example `inset-y-0 left-0 w-3.5`, inside a positioned
* item. Inside a tab trigger it shows only while that tab is active.
*/
function StandingSeam({
color = "cyan",
tone = "auto",
className,
style,
...props
}: React.ComponentProps<"span"> & {
/** The named color; `cyan` by default. See `SEAM_COLORS`. */
color?: SeamColor
/** `auto` follows the scheme; `glow` or `ink` forces one face. */
tone?: SeamTone
}) {
return (
<span
aria-hidden="true"
data-slot="standing-seam"
data-color={color}
className={cn(
// In a tab trigger it lights only the active one.
"pointer-events-none absolute in-data-[slot=tabs-trigger]:opacity-0 in-data-[slot=tabs-trigger]:in-data-active:opacity-100",
"[--ss-bloom:var(--ss-light-bloom)] [--ss-core:var(--ss-light-core)] [--ss-edge:var(--ss-light-edge)]",
"dark:[--ss-bloom:var(--ss-dark-bloom)] dark:[--ss-core:var(--ss-dark-core)] dark:[--ss-edge:var(--ss-dark-edge)]",
className
)}
style={{ ...seamVars("ss", color, tone), ...style }}
{...props}
>
<span
className="absolute inset-y-2 left-0 w-[1.5px]"
style={{
background:
"linear-gradient(180deg, transparent, var(--ss-edge) 30%, var(--ss-core) 50%, var(--ss-edge) 70%, transparent)",
}}
/>
<span
className="absolute inset-y-1 -left-1.5 w-3.5 blur-[7px] dark:mix-blend-screen"
style={{
background:
"radial-gradient(50% 60% at 50% 50%, var(--ss-bloom), transparent 78%)",
}}
/>
</span>
)
}
export { GlowSeam, StandingSeam, SEAM_COLORS }
export type { SeamColor, SeamTone }
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"
// No width of its own: the SectionHeader column (or whatever holds it) is
// the measure. text-pretty keeps a wrapped title from ending on one word.
// font-display follows font-sans unless the block switches it, for example
// with [--font-display:var(--font-serif)].
const subheadingVariants = cva(
"font-display font-[450] tracking-[-0.05em] text-pretty sm:tracking-[-0.06em]",
{
variants: {
/**
* `default` inherits the surrounding display face. `serif` uses
* the kit's serif role, without changing the surrounding font.
*/
variant: {
default: "",
serif: "[--font-display:var(--font-serif)]",
},
/**
* `md` (the default): 32px/40px, capped at 40px/44px from `sm`.
* `lg`: 32px/40px, 40px/48px from `sm`, 48px/56px from `lg`.
* `xl`: 32px/40px, 48px/56px from `sm`, 56px/56px from `lg`.
*/
size: {
md: "text-[2rem]/10 sm:text-[2.5rem]/11",
lg: "text-[2rem]/10 sm:text-[2.5rem]/12 lg:text-5xl/14",
xl: "text-[2rem]/10 sm:text-5xl/14 lg:text-[3.5rem]/14",
},
},
defaultVariants: { variant: "default", size: "md" },
}
)
/**
* The section heading in the display font, which follows `font-sans`
* unless a block switches that role. Rendered as an `<h2>` at weight 450.
* The default `size="md"` steps
* from 32px/40px to 40px/44px at `sm` and stays there. Choose `size="lg"`
* for 32px/40px, 40px/48px at `sm` and 48px/56px at `lg`, or `size="xl"`
* for 32px/40px, 48px/56px at `sm` and 56px/56px at `lg`.
* `variant="serif"` uses the kit's serif role; the default keeps the
* surrounding display face. Both variants support all three sizes.
* Pass `render` to use another heading level. A page's headline is `Heading`.
*/
function Subheading({
className,
variant = "default",
size = "md",
render,
...props
}: useRender.ComponentProps<"h2"> & VariantProps<typeof subheadingVariants>) {
return useRender({
defaultTagName: "h2",
render,
state: { slot: "subheading", variant, size },
props: mergeProps<"h2">(
{
className: cn(subheadingVariants({ variant, size }), className),
},
props
),
})
}
export { Subheading, subheadingVariants }
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"
// Paragraphs in introductions and body content. The layout owns the text
// measure: give it a `max-w-*` class when needed. Inherits the surrounding
// ink, so it reads over art; muted steps it down on a flat ground.
const textVariants = cva("w-full min-w-0 text-pretty", {
variants: {
/**
* The text color. `default` (the default) keeps the inherited color.
* `muted` uses `muted-foreground`.
*/
variant: {
default: "",
muted: "text-muted-foreground",
},
/**
* The text size: `md` (the default) 16px/28px for body copy; `lg`
* 18px/28px for an introduction; `xl` 18px/28px, then 20px/32px from
* `sm` for a hero introduction.
*/
size: {
md: "text-base/7",
lg: "text-lg/7",
xl: "text-lg/7 sm:text-xl/8",
},
},
defaultVariants: { variant: "default", size: "md" },
})
/**
* A paragraph in an introduction or body content, a `p` by default. For
* several paragraphs, pass `render={<div />}` and put your own `p` elements
* inside.
*
* `size` sets the text: `md` (the default) 16px/28px, `lg` 18px/28px, or
* `xl` 18px/28px and 20px/32px from `sm` for a hero. The layout controls
* the text's width and spacing. `variant="muted"`
* uses the muted text color; the default inherits the ink around it.
*/
function Text({
className,
variant = "default",
size = "md",
render,
...props
}: useRender.ComponentProps<"p"> & VariantProps<typeof textVariants>) {
return useRender({
defaultTagName: "p",
render,
state: { slot: "text", variant, size },
props: mergeProps<"p">(
{ className: cn(textVariants({ variant, size }), className) },
props
),
})
}
export { Text, textVariants }
Installation
pnpm dlx shadcn@latest add @01orbital/route-cards-01npx shadcn@latest add @01orbital/route-cards-01yarn dlx shadcn@latest add @01orbital/route-cards-01bunx --bun shadcn@latest add @01orbital/route-cards-01Make it yours
- Its words are in
COPYat the top ofcomponents/blocks/cta/route-cards-01/index.tsx: change them there, not in the markup. ROUTES, also at the top of the file, holds its lists and settings.- Its look comes from Glow Seam; each page lists the props that change it.
Built from
npm: @01orbital/font-geist-serif, cn. The CLI installs them for you.
Built from these parts. The CLI adds each one that is missing and won't replace a file you already have unless you choose to:
The shadcn parts here are their Base UI versions, and this piece uses Base UI's API. A Radix version you already have won't work with it.
Last updated on