Color Wash Card
Article card with a painted color wash band across the top and a paper body: a label, serif headline, description, byline and a save button.
"use client"
import { useState } from "react"
import {
Byline,
BylineDescription,
BylineName,
} from "@/components/byline/byline"
import { Eyebrow } from "@/components/eyebrow/eyebrow"
import { ColorWash } from "@/components/scene/color-wash"
import { Button } from "@/components/ui/button"
import {
Card,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
// The copy: change text here, not in the markup.
const COPY = {
eyebrow: "Material studies",
title: "Color is a material, too.",
description:
"Painted fields, soft edges, and what happens when you stop treating the background as an afterthought.",
author: "Lenka Sorrel",
byline: "On making · 7 min read",
cta: "Save for later",
saved: "Saved",
} as const
/** A card with a ColorWash band across the top and a paper body: a label, a headline, a byline and a save button. */
export default function ColorWashCard() {
const [saved, setSaved] = useState(false)
return (
<Card className="relative isolate min-h-80 w-full max-w-md min-w-0 gap-8 pt-0 [--card-spacing:--spacing(8)] min-[42rem]:[--card-spacing:--spacing(10)]">
{/* The gold band sits behind the top of the card; the spacer in the
header keeps the eyebrow 192px down, clear of it. */}
<div
className="dark absolute inset-x-0 top-0 h-44 overflow-hidden bg-background"
aria-hidden="true"
>
<ColorWash
color="gold"
grain={0.2}
className="absolute inset-0 size-full min-h-0"
/>
</div>
<CardHeader className="relative z-2 grid-cols-[minmax(0,var(--container-md))] justify-between gap-4">
<div>
<div aria-hidden="true" className="h-48" />
<Eyebrow variant="mono" className="text-current">
{COPY.eyebrow}
</Eyebrow>
</div>
<CardTitle
role="heading"
aria-level={3}
className="text-2xl/8 font-[450] tracking-[-0.04em] text-pretty @sm/card-header:text-3xl/9"
>
<span className="font-serif font-normal tracking-tight">
{COPY.title}
</span>
</CardTitle>
<CardDescription className="col-span-full w-full min-w-0 text-base/7 text-balance text-current/75">
{COPY.description}
</CardDescription>
</CardHeader>
<CardFooter className="relative z-2 mt-auto flex-wrap justify-between gap-x-6 gap-y-2 text-xs/5">
<Byline size="sm">
<BylineName>{COPY.author}</BylineName>
<BylineDescription>{COPY.byline}</BylineDescription>
</Byline>
<Button
variant="outline"
aria-pressed={saved}
onClick={() => setSaved(!saved)}
className="h-auto min-h-10 max-w-full py-2.5 text-center whitespace-normal"
>
{saved ? COPY.saved : COPY.cta}
</Button>
</CardFooter>
</Card>
)
}
import type { ComponentProps } from "react"
import { mergeProps } from "@base-ui/react/merge-props"
import { useRender } from "@base-ui/react/use-render"
import { cn } from "cn"
type BylineSize = "md" | "sm"
type BylineState = { slot: "byline"; size: BylineSize }
type BylineAvatarState = { slot: "byline-avatar" }
/**
* A person's byline: an optional `BylineAvatar`, then `BylineName` with a
* `BylineDescription` under it, as a `div`. With an avatar it becomes two
* columns: the avatar spans both lines, 16px from the text. Under a quote,
* pass `render={<figcaption />}`; in a centered quote add `w-fit text-left` so it shrinks to fit
* and keeps its text left-aligned.
*
* At `size="md"` (the default) the name is 16px/24px semibold and the
* description 14px/20px muted, 2px apart; a 40px avatar matches the two
* lines. At `size="sm"` both lines are 12px/20px, the name in regular weight,
* the byline of a card footer.
*/
function Byline({
className,
size = "md",
render,
...props
}: useRender.ComponentProps<"div", BylineState> & {
/** The type size: `md` (the default) 16px over 14px, `sm` 12px over 12px for a card footer. */
size?: BylineSize
}) {
return useRender({
defaultTagName: "div",
render,
state: { slot: "byline", size },
props: mergeProps<"div">(
{
className: cn(
"group/byline grid items-center gap-x-4 gap-y-0.5 text-sm/5 has-data-[slot=byline-avatar]:grid-cols-[auto_1fr] data-[size=sm]:text-xs/5",
className
),
},
props
),
})
}
/**
* Holds the person's picture beside the name and description: a stock
* `Avatar`, an orb avatar or an image, 40px recommended. Use
* `render={<div />}` when the artwork has a block root.
*/
function BylineAvatar({
className,
render,
...props
}: useRender.ComponentProps<"span", BylineAvatarState>) {
return useRender({
defaultTagName: "span",
render,
state: { slot: "byline-avatar" },
props: mergeProps<"span">(
{ className: cn("row-span-2 flex", className) },
props
),
})
}
/** The person's name, 16px/24px semibold, held close to the line below; 12px regular in a `sm` byline. */
function BylineName({ className, ...props }: ComponentProps<"span">) {
return (
<span
data-slot="byline-name"
className={cn(
"self-end text-base/6 font-semibold group-data-[size=sm]/byline:text-xs/5 group-data-[size=sm]/byline:font-normal",
className
)}
{...props}
/>
)
}
/**
* The second line under the name, such as a job title, a company, a handle
* or a date, in 14px/20px muted text; 12px in a `sm` byline.
*/
function BylineDescription({ className, ...props }: ComponentProps<"span">) {
return (
<span
data-slot="byline-description"
className={cn("self-start text-muted-foreground", className)}
{...props}
/>
)
}
export { Byline, BylineAvatar, BylineName, BylineDescription }
import type * as React from "react"
import { cn } from "cn"
import {
ORBITAL_PALETTES,
type OrbitalPalette,
type OrbitalPaletteName,
} from "@/components/orbs/orbital-palettes"
// Paper grain: an SVG turbulence filter as a data URI.
const PAPER_GRAIN = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='250' height='250' viewBox='0 0 100 100'%3E%3Cfilter id='n' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='turbulence' baseFrequency='1.4' numOctaves='1' seed='2' stitchTiles='stitch' result='n'/%3E%3CfeComponentTransfer result='g'%3E%3CfeFuncR type='linear' slope='4' intercept='1'/%3E%3CfeFuncG type='linear' slope='4' intercept='1'/%3E%3CfeFuncB type='linear' slope='4' intercept='1'/%3E%3C/feComponentTransfer%3E%3CfeColorMatrix type='saturate' values='0' in='g'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")`
/** A palette of your own: a ground and the two fields painted over it. */
type ColorWashPalette = Pick<OrbitalPalette, "ground" | "upper" | "lower">
type ColorWashFinishProps = {
/**
* A named palette from `ORBITAL_PALETTES`, the table Orbital paints from
* too. The default is `delft`, cream over blue.
*/
color?: OrbitalPaletteName
/**
* Your own ground, upper and lower field. Replaces the named `color`; the
* wash reports `data-color="custom"`.
*/
palette?: ColorWashPalette
/** Blur on the upper field, in px. Default 44. */
upperBlur?: number
/** Blur on the lower field, in px. Default 52. */
lowerBlur?: number
/** Grain opacity, 0 to 1. Default 0.5. */
grain?: number
/** Height of the upper field, as a percentage of the frame. Default 78. */
upperHeight?: number
/** Height of the lower field, as a percentage of the frame. Default 65. */
lowerHeight?: number
/**
* OKLCH lightness added to the ground, kept within 0 to 1; positive values
* lighten. Default 0.
*/
groundLift?: number
}
/**
* A box painted as a soft color field, a ground with a blurred upper and
* lower field and a grain overlay, used as a background for cards and
* sections. `color` picks a named palette from `ORBITAL_PALETTES`, the
* default is `delft`, and `palette` takes one of your own.
*
* Children render above the wash in a full-height wrapper. The wash layers
* are hidden from assistive tech and take no pointer events.
*/
function ColorWash({
className,
color,
palette,
style,
children,
upperBlur = 44,
lowerBlur = 52,
grain = 0.5,
upperHeight = 78,
lowerHeight = 65,
groundLift = 0,
...props
}: React.ComponentProps<"div"> & ColorWashFinishProps) {
const paint = palette ?? ORBITAL_PALETTES[color ?? "delft"]
return (
<div
data-slot="color-wash"
data-color={palette ? "custom" : (color ?? "delft")}
className={cn("relative isolate overflow-hidden", className)}
style={
{
"--color-wash-ground": paint.ground,
"--color-wash-upper": paint.upper,
"--color-wash-lower": paint.lower,
...style,
} as React.CSSProperties
}
{...props}
>
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0"
style={{
background:
groundLift === 0
? "var(--color-wash-ground)"
: `oklch(from var(--color-wash-ground) clamp(0, calc(l + ${groundLift}), 1) c h)`,
}}
>
<div
className="absolute inset-x-0 top-[-20%]"
style={{
background: "var(--color-wash-upper)",
height: `${Math.max(0, upperHeight)}%`,
filter: `blur(${Math.max(0, upperBlur)}px)`,
}}
/>
<div
className="absolute inset-x-0 bottom-[-15%]"
style={{
background: "var(--color-wash-lower)",
height: `${Math.max(0, lowerHeight)}%`,
filter: `blur(${Math.max(0, lowerBlur)}px)`,
}}
/>
</div>
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0 mix-blend-overlay"
style={{
opacity: Math.min(1, Math.max(0, grain)),
backgroundImage: PAPER_GRAIN,
}}
/>
<div className="relative h-full">{children}</div>
</div>
)
}
export { ColorWash }
export type { ColorWashPalette }
// Named palettes for the painted fields: a ground with an upper and a lower
// field blurred over it, the way Orbital paints a ball and ColorWash paints
// a panel. Plain data with no imports, so any component can read it. Pass a
// name to ColorWash as `color`, or an entry (or your own object of the same
// shape) to Orbital or ColorWash as `palette`.
type OrbitalPalette = {
/** The base color under everything else, any CSS color. */
ground: string
/** A CSS background, usually a radial gradient, blurred over the top. */
upper: string
/** A CSS background blurred over the bottom. */
lower: string
/** The orb's glow: an inner bloom and a halo. ColorWash ignores it. */
glow?: string
/** The orb's preferred shading tier. ColorWash ignores it. */
form?: "off" | "medium" | "strong"
/** Read by nothing today; kept so older palettes still type-check. */
period?: "nocturne"
}
type OrbitalPaletteName =
| "gold"
| "delft"
| "warmth"
| "marigold"
| "vesper"
| "aurora"
| "gesso"
| "plaster"
| "moss"
| "tidepool"
| "vermillion"
| "cocoa"
| "linen"
| "tarn"
| "gold-dark"
| "mint"
| "rose"
| "sky"
| "lilac"
| "pewter"
| "oxblood"
| "heather"
| "chambray"
| "lichen"
| "mallow"
| "kiln"
const ORBITAL_PALETTES: Record<OrbitalPaletteName, OrbitalPalette> = {
gold: {
ground: "oklch(0.315 0.064 270.3)",
upper:
"radial-gradient(ellipse 135% 105% at 50% 35%, oklch(0.875 0.097 100.4) 0%, oklch(0.850 0.101 100.7 / 0.7) 52%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 95% at 50% 80%, oklch(0.365 0.073 269.3) 0%, oklch(0.365 0.073 269.3 / 0.8) 56%, transparent 100%)",
glow: "oklch(0.936 0.055 102.9)",
form: "strong",
},
delft: {
ground: "oklch(0.376 0.087 261.9)",
upper:
"radial-gradient(ellipse 135% 105% at 50% 35%, oklch(0.905 0.025 104.4) 0%, oklch(0.887 0.026 104.5 / 0.72) 52%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 95% at 50% 80%, oklch(0.467 0.121 261.9) 0%, oklch(0.467 0.121 261.9 / 0.8) 55%, transparent 100%)",
glow: "oklch(0.978 0.010 261.8)",
form: "strong",
},
warmth: {
ground: "oklch(0.652 0.147 52.4)",
upper:
"radial-gradient(ellipse 130% 100% at 50% 35%, oklch(0.836 0.159 96.2) 0%, oklch(0.814 0.157 92.4 / 0.7) 55%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 90% at 50% 80%, oklch(0.518 0.176 28.9) 0%, oklch(0.487 0.167 27.7 / 0.8) 55%, transparent 100%)",
glow: "oklch(0.836 0.159 96.2)",
},
marigold: {
ground: "oklch(0.379 0.076 35.6)",
upper:
"radial-gradient(ellipse 135% 105% at 50% 35%, oklch(0.805 0.160 71.9) 0%, oklch(0.805 0.160 71.9 / 0.75) 53%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 95% at 50% 80%, oklch(0.243 0.023 32.4) 0%, oklch(0.243 0.023 32.4 / 0.88) 56%, transparent 100%)",
glow: "oklch(0.829 0.154 76.5)",
form: "strong",
},
vesper: {
ground: "oklch(0.28 0.06 300)",
upper:
"radial-gradient(ellipse 135% 105% at 50% 35%, oklch(0.90 0.04 55) 0%, oklch(0.90 0.04 55 / 0.7) 53%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 95% at 50% 80%, oklch(0.42 0.13 305) 0%, oklch(0.42 0.13 305 / 0.85) 56%, transparent 100%)",
glow: "oklch(0.82 0.07 50)",
form: "strong",
},
aurora: {
ground: "oklch(0.318 0.057 158.2)",
upper:
"radial-gradient(ellipse 140% 110% at 50% 45%, oklch(0.890 0.129 146.1) 0%, oklch(0.890 0.129 146.1 / 0.5) 55%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 100% at 50% 55%, oklch(0.236 0.055 296.3) 0%, oklch(0.236 0.055 296.3 / 0.5) 55%, transparent 100%)",
},
gesso: {
ground: "oklch(0.563 0.167 30.8)",
upper:
"radial-gradient(ellipse 135% 105% at 50% 35%, oklch(0.919 0.014 53.3) 0%, oklch(0.907 0.011 45.7 / 0.75) 52%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 95% at 50% 80%, oklch(0.621 0.161 28.1) 0%, oklch(0.621 0.161 28.1 / 0.8) 55%, transparent 100%)",
glow: "oklch(0.949 0.014 53.3)",
form: "strong",
},
plaster: {
ground: "oklch(0.728 0.030 93.8)",
upper:
"radial-gradient(ellipse 135% 105% at 50% 35%, oklch(0.787 0.035 68.7) 0%, oklch(0.787 0.035 68.7 / 0.65) 52%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 95% at 50% 80%, oklch(0.547 0.181 27.1) 0%, oklch(0.516 0.172 26.6 / 0.75) 55%, transparent 100%)",
glow: "oklch(0.561 0.158 29.1)",
form: "strong",
},
moss: {
ground: "oklch(0.313 0.006 34.3)",
upper:
"radial-gradient(ellipse 135% 105% at 50% 35%, oklch(0.561 0.039 200.7) 0%, oklch(0.507 0.038 203.1 / 0.7) 55%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 95% at 50% 80%, oklch(0.373 0.047 214.5) 0%, oklch(0.395 0.046 210.5 / 0.8) 56%, transparent 100%)",
glow: "oklch(0.659 0.131 237.7)",
form: "medium",
},
tidepool: {
ground: "oklch(0.179 0.029 240.3)",
upper:
"radial-gradient(ellipse 140% 110% at 50% 45%, oklch(0.413 0.082 166.3) 0%, oklch(0.413 0.082 166.3 / 0.5) 55%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 100% at 50% 55%, oklch(0.962 0.077 113.3) 0%, oklch(0.962 0.077 113.3 / 0.5) 55%, transparent 100%)",
},
vermillion: {
ground: "oklch(0.235 0.06 18.06)",
upper:
"radial-gradient(ellipse 130% 100% at 50% 38%, oklch(0.66 0.205 30.97) 0%, oklch(0.619 0.205 30.96 / 60%) 55%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 90% at 50% 82%, oklch(0.28 0.136 266.87) 0%, oklch(0.25 0.136 267.22 / 70%) 55%, transparent 100%)",
},
cocoa: {
ground: "oklch(0.306 0.066 45.1)",
upper:
"radial-gradient(ellipse 135% 105% at 50% 35%, oklch(0.794 0.054 64.1) 0%, oklch(0.794 0.054 64.1 / 0.75) 52%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 95% at 50% 80%, oklch(0.457 0.115 42.0) 0%, oklch(0.457 0.115 42.0 / 0.84) 56%, transparent 100%)",
glow: "oklch(0.762 0.120 49.2)",
form: "strong",
},
linen: {
ground: "oklch(0.267 0.021 54.1)",
upper:
"radial-gradient(ellipse 135% 105% at 50% 35%, oklch(0.782 0.021 58.0) 0%, oklch(0.782 0.021 58.0 / 0.75) 52%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 95% at 50% 80%, oklch(0.363 0.028 53.6) 0%, oklch(0.363 0.028 53.6 / 0.85) 56%, transparent 100%)",
glow: "oklch(0.994 0.000 89.9)",
form: "strong",
},
tarn: {
ground: "oklch(0.286 0.036 189.5)",
upper:
"radial-gradient(ellipse 135% 105% at 50% 35%, oklch(0.757 0.155 95.6) 0%, oklch(0.757 0.155 95.6 / 0.72) 52%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 95% at 50% 80%, oklch(0.468 0.065 190.9) 0%, oklch(0.468 0.065 190.9 / 0.82) 56%, transparent 100%)",
glow: "oklch(0.831 0.167 96.2)",
form: "strong",
},
"gold-dark": {
ground: "oklch(0.16 0.04 270)",
upper:
"radial-gradient(ellipse 135% 105% at 50% 35%, oklch(0.29 0.06 100) 0%, oklch(0.27 0.06 101 / 0.7) 52%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 95% at 50% 80%, oklch(0.23 0.07 269) 0%, oklch(0.23 0.07 269 / 0.8) 56%, transparent 100%)",
},
mint: {
ground: "oklch(0.315 0.06368 314.9)",
upper:
"radial-gradient(ellipse 135% 105% at 50% 35%, oklch(0.875 0.09651 145.0) 0%, oklch(0.850 0.10049 145.3 / 0.7) 52%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 95% at 50% 80%, oklch(0.365 0.07263 313.9) 0%, oklch(0.365 0.07263 313.9 / 0.8) 56%, transparent 100%)",
},
rose: {
ground: "oklch(0.315 0.04852 149.9)",
upper:
"radial-gradient(ellipse 135% 105% at 50% 35%, oklch(0.875 0.07355 340.0) 0%, oklch(0.850 0.07658 340.3 / 0.7) 52%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 95% at 50% 80%, oklch(0.365 0.05535 148.9) 0%, oklch(0.365 0.05535 148.9 / 0.8) 56%, transparent 100%)",
},
sky: {
ground: "oklch(0.315 0.04989 29.9)",
upper:
"radial-gradient(ellipse 135% 105% at 50% 35%, oklch(0.875 0.07562 220.0) 0%, oklch(0.850 0.07874 220.3 / 0.7) 52%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 95% at 50% 80%, oklch(0.365 0.05691 28.9) 0%, oklch(0.365 0.05691 28.9 / 0.8) 56%, transparent 100%)",
},
lilac: {
ground: "oklch(0.315 0.03869 99.9)",
upper:
"radial-gradient(ellipse 135% 105% at 50% 35%, oklch(0.875 0.05864 290.0) 0%, oklch(0.850 0.06106 290.3 / 0.7) 52%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 95% at 50% 80%, oklch(0.365 0.04413 98.9) 0%, oklch(0.365 0.04413 98.9 / 0.8) 56%, transparent 100%)",
},
pewter: {
ground: "oklch(0.240 0.022 91.8)",
upper:
"radial-gradient(ellipse 135% 105% at 50% 35%, oklch(0.577 0.031 306.8) 0%, oklch(0.524 0.029 305.5 / 0.75) 54%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 95% at 50% 80%, oklch(0.263 0.022 329.5) 0%, oklch(0.263 0.022 329.5 / 0.85) 56%, transparent 100%)",
glow: "oklch(0.964 0.006 308.4)",
form: "medium",
period: "nocturne",
},
oxblood: {
ground: "oklch(0.247 0.023 277.2)",
upper:
"radial-gradient(ellipse 140% 110% at 50% 45%, oklch(0.456 0.136 21.1) 0%, oklch(0.456 0.136 21.1 / 0.5) 55%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 100% at 50% 55%, oklch(0.655 0.090 76.4) 0%, oklch(0.655 0.090 76.4 / 0.5) 55%, transparent 100%)",
},
heather: {
ground: "oklch(0.561 0.203 32.9)",
upper:
"radial-gradient(ellipse 135% 105% at 50% 35%, oklch(0.923 0.021 48.5) 0%, oklch(0.915 0.019 38.1 / 0.75) 52%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 95% at 50% 80%, oklch(0.550 0.091 357.3) 0%, oklch(0.602 0.095 359.5 / 0.8) 55%, transparent 100%)",
glow: "oklch(0.940 0.017 44.8)",
form: "strong",
},
chambray: {
ground: "oklch(0.280 0.110 251.6)",
upper: "oklch(0.905 0.040 251.6)",
lower: "oklch(0.450 0.155 251.6)",
glow: "oklch(0.840 0.075 251.6)",
form: "strong",
},
lichen: {
ground: "oklch(0.258 0.027 329.1)",
upper:
"radial-gradient(ellipse 140% 110% at 50% 45%, oklch(0.551 0.058 87.6) 0%, oklch(0.551 0.058 87.6 / 0.5) 55%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 100% at 50% 55%, oklch(0.234 0.035 278.5) 0%, oklch(0.234 0.035 278.5 / 0.5) 55%, transparent 100%)",
period: "nocturne",
},
mallow: {
ground: "oklch(0.250 0.050 325)",
upper:
"radial-gradient(ellipse 135% 105% at 50% 35%, oklch(0.87 0.06 350) 0%, oklch(0.80 0.07 340 / 0.8) 52%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 95% at 50% 80%, oklch(0.34 0.09 320) 0%, oklch(0.28 0.07 325 / 0.85) 56%, transparent 100%)",
glow: "oklch(0.88 0.07 350)",
form: "medium",
},
kiln: {
ground: "oklch(0.408 0.085 48.6)",
upper:
"radial-gradient(ellipse 135% 105% at 50% 35%, oklch(0.757 0.089 60.2) 0%, oklch(0.757 0.089 60.2 / 0.75) 53%, transparent 100%)",
lower:
"radial-gradient(ellipse 130% 95% at 50% 80%, oklch(0.583 0.121 44.5) 0%, oklch(0.583 0.121 44.5 / 0.8) 55%, transparent 100%)",
glow: "oklch(0.834 0.088 72.9)",
form: "strong",
},
}
/** One line per palette, for pickers and captions. */
const ORBITAL_PALETTE_NOTES: Record<OrbitalPaletteName, string> = {
gold: "pale gold over indigo, the Orbital default",
delft: "cream over blue",
warmth: "gold over terracotta",
marigold: "gold over rust",
vesper: "pale peach over violet",
aurora: "mint over deep green",
gesso: "warm white over red-orange",
plaster: "rose over plaster",
moss: "sky over warm grey",
tidepool: "teal over deep blue",
vermillion: "cream over oxblood",
cocoa: "pale sand over cocoa",
linen: "pale sand over umber",
tarn: "gold over deep teal",
"gold-dark": "dim gold over near-black blue",
mint: "pale mint over plum",
rose: "pale pink over deep green",
sky: "pale blue over dark brown",
lilac: "pale lilac over dark olive",
pewter: "grey lilac over dark umber",
oxblood: "oxblood over ochre",
heather: "warm white over dusty rose",
chambray: "pale blue over deep blue",
lichen: "khaki over dark indigo",
mallow: "pale pink over plum",
kiln: "apricot over terracotta",
}
export { ORBITAL_PALETTES, ORBITAL_PALETTE_NOTES }
export type { OrbitalPalette, OrbitalPaletteName }
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` is a 12px/20px label in the mono face, in sentence case like
* the others: the kit sets no label in capitals.
*/
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",
},
},
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: a `p` is
* right when the label stands alone as a line of text; pass
* `render={<span />}` or `render={<div />}` when it sits inside a heading,
* link, button or other inline text, where a `p` is not valid HTML.
*/
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 }
Installation
npx shadcn@latest add @01orbital/color-wash-card-01Make it yours
- Its words are in
COPYat the top ofcomponents/blocks/card/color-wash-card-01/index.tsx: change them there, not in the markup. - Its look comes from Color Wash; each page lists the props that change it.
Built from
npm: @01orbital/font-geist-serif. The CLI installs it 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