Bezel Glass Card
Product announcement in a Headline Card with a glowing jade bezel edge: a mono label, a sans headline, a short description, a byline and one button.
import { cn } from "cn"
import {
Byline,
BylineDescription,
BylineName,
} from "@/components/byline/byline"
import {
HeadlineCard,
HeadlineCardDescription,
HeadlineCardFooter,
HeadlineCardHeader,
HeadlineCardMeta,
HeadlineCardTitle,
} from "@/components/card/headline-card"
import { Eyebrow } from "@/components/eyebrow/eyebrow"
import { buttonVariants } from "@/components/ui/button"
// The copy: change text here, not in the markup.
const COPY = {
eyebrow: "Introducing Quillmere 2.0",
title: "One place for your next chapter.",
description:
"Projects, notes, and a shared picture of the week. Quillmere’s new workspace is ready to try.",
brand: "Quillmere",
byline: "Product update · November 2026",
cta: "See the workspace",
} as const
/** A HeadlineCard with a jade limned edge and a sans headline, for a product announcement with a link to the release. */
export default function HeadlineCardJadeAnnouncement() {
return (
<HeadlineCard className="theme-blue surface-limned relative isolate mx-auto w-full max-w-md min-w-0">
<HeadlineCardHeader>
<HeadlineCardMeta>
<Eyebrow variant="mono" className="text-current">
{COPY.eyebrow}
</Eyebrow>
</HeadlineCardMeta>
<HeadlineCardTitle className="font-normal tracking-[-0.025em]">
{COPY.title}
</HeadlineCardTitle>
<HeadlineCardDescription>{COPY.description}</HeadlineCardDescription>
</HeadlineCardHeader>
<HeadlineCardFooter>
<Byline size="sm">
<BylineName>{COPY.brand}</BylineName>
<BylineDescription>{COPY.byline}</BylineDescription>
</Byline>
<a
href="#"
data-slot="button"
className={cn(
buttonVariants(),
"h-auto min-h-[38px] max-w-full py-[9px] text-center whitespace-normal"
)}
>
{COPY.cta}
</a>
</HeadlineCardFooter>
</HeadlineCard>
)
}
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 { 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 { ComponentProps } from "react"
import { ArrowRightIcon } from "@phosphor-icons/react/ssr"
import { cn } from "cn"
import { textVariants } from "@/components/text/text"
import { buttonVariants } from "@/components/ui/button"
import {
Card,
CardAction,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
/**
* A card for a headline, such as an article or a case study. Compose it from
* its parts: a `HeadlineCardHeader` holding an optional `HeadlineCardMeta`,
* the `HeadlineCardTitle`, a `HeadlineCardDescription` and a
* `HeadlineCardLink`, then a `HeadlineCardFooter` pushed to the bottom. It is
* the kit's `Card`, styled; at least 320px tall, with padding that grows from
* 32px to 40px on screens 42rem and wider. The title steps from 24px to 30px
* once the card is 24rem wide, reading the stock `card-header` container.
*
* It uses the card background unless you pass a surface utility, such as
* `surface-frost`, in `className`. Every part takes `className` to restyle it.
*/
function HeadlineCard({ className, ...props }: ComponentProps<typeof Card>) {
return (
<Card
data-slot="headline-card"
className={cn(
"min-h-80 gap-8 [--card-spacing:--spacing(8)] min-[42rem]:[--card-spacing:--spacing(10)]",
className
)}
{...props}
/>
)
}
/**
* The card's top block, which holds the meta, title, description and link.
* The stock `card-header` container, so the title steps on its width. The copy is capped at 28rem and
* the link sits at the far edge.
*/
function HeadlineCardHeader({
className,
...props
}: ComponentProps<typeof CardHeader>) {
return (
<CardHeader
data-slot="headline-card-header"
className={cn(
"grid-cols-[minmax(0,var(--container-md))] justify-between gap-4 has-data-[slot=card-action]:grid-cols-[minmax(0,var(--container-md))_auto]",
className
)}
{...props}
/>
)
}
/**
* A line above the headline, such as a category and a date. It takes any
* content and has no styling of its own.
*/
function HeadlineCardMeta({ className, ...props }: ComponentProps<"div">) {
return <div data-slot="headline-card-meta" className={className} {...props} />
}
/**
* The headline, read as a level-3 heading, in the body font (Geist). Pass
* `aria-level` to change the level.
*/
function HeadlineCardTitle({
className,
...props
}: ComponentProps<typeof CardTitle>) {
return (
<CardTitle
data-slot="headline-card-title"
role="heading"
aria-level={3}
className={cn(
"text-2xl/8 font-[450] tracking-[-0.04em] text-pretty @sm/card-header:text-3xl/9",
className
)}
{...props}
/>
)
}
/** The text under the headline, at 75% of the card's text color. */
function HeadlineCardDescription({
className,
...props
}: ComponentProps<typeof CardDescription>) {
return (
<CardDescription
data-slot="headline-card-description"
className={cn(textVariants(), "text-current/75", className)}
{...props}
/>
)
}
/**
* The round link at the top right of the header, an arrow unless you pass
* other children. With only the arrow, give it an `aria-label`, such as
* "Read guide: …"; `href` is where it goes. `className` goes on the link
* itself.
*/
function HeadlineCardLink({
className,
children,
...props
}: ComponentProps<"a">) {
return (
<CardAction>
<a
data-slot="button"
className={cn(
buttonVariants({ variant: "secondary", size: "icon-lg" }),
className
)}
{...props}
>
{children ?? <ArrowRightIcon aria-hidden="true" />}
</a>
</CardAction>
)
}
/**
* The card's bottom row, pushed to the bottom: a wrapping flex row with the
* items centered and spread apart, 24px by 8px gaps, in 12px text. Put a
* `Byline size="sm"` on the left and a button or link on the right.
*/
function HeadlineCardFooter({
className,
...props
}: ComponentProps<typeof CardFooter>) {
return (
<CardFooter
data-slot="headline-card-footer"
className={cn(
"mt-auto flex-wrap justify-between gap-x-6 gap-y-2 text-xs/5",
className
)}
{...props}
/>
)
}
export {
HeadlineCard,
HeadlineCardDescription,
HeadlineCardFooter,
HeadlineCardHeader,
HeadlineCardLink,
HeadlineCardMeta,
HeadlineCardTitle,
}
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/bezel-glass-card-01npx shadcn@latest add @01orbital/bezel-glass-card-01yarn dlx shadcn@latest add @01orbital/bezel-glass-card-01bunx --bun shadcn@latest add @01orbital/bezel-glass-card-01Make it yours
- Its words are in
COPYat the top ofcomponents/blocks/card/bezel-glass-card-01/index.tsx: change them there, not in the markup.
Built from
npm: cn. 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