Editorial

Eyebrow

Short label set above a heading. Default is 12px uppercase Geist Mono with wide tracking in muted ink; sans is a 14px semibold line in sentence case. Pulls in the Geist Mono font item.

Free, MIT licenseOpen in Browse
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 the mono label: 12px uppercase at weight 400. sans is a 14px
// semibold line in sentence case, a shade lighter than the heading.
const eyebrowVariants = cva("", {
  variants: {
    /**
     * The label style. `default` (the default) is a 12px uppercase mono
     * label in `muted-foreground` with wide letter spacing. `sans` is a 14px
     * semibold line, cased as written, in `foreground` at 80% opacity.
     */
    variant: {
      default:
        "font-mono text-xs/5 font-normal tracking-widest text-muted-foreground uppercase",
      sans: "text-sm/7 font-semibold text-foreground/80",
    },
  },
  defaultVariants: { variant: "default" },
})

/**
 * A short label set above a heading, such as a section name, rendered as a
 * `<p>`. Pass `render` to use another element.
 *
 * `default` is a 12px uppercase mono label in the muted color with wide
 * letter spacing. `sans` is a 14px semibold line, cased as written, in the
 * text color at 80% opacity.
 */
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

pnpm dlx shadcn add @01orbital/eyebrow
npx shadcn add @01orbital/eyebrow
yarn shadcn add @01orbital/eyebrow
bunx --bun shadcn add @01orbital/eyebrow

Free under the MIT license. Add the @01orbital registry to components.json once (install guide), then run the command.

It lands at components/editorial/eyebrow.tsx, as source you own and edit.

Usage

import { Eyebrow } from "@/components/editorial/eyebrow"

const COPY = {
  default: "Built for scale",
  mono: "Selected work",
}

export default function EyebrowDemo() {
  return (
    <div className="grid w-full max-w-2xl place-items-center gap-8 p-6">
      <Eyebrow>{COPY.default}</Eyebrow>
      <Eyebrow>{COPY.mono}</Eyebrow>
    </div>
  )
}

API reference

Prop

Type

It also accepts the props of the Base UI part it wraps, and the HTML attributes of the element it renders.

Dependencies

npm: @base-ui/react, class-variance-authority, cn. The CLI installs them for you.

Registry pieces it installs with it:

  • font-geist-mono