Skip to Content

Title

Card and panel title component: a responsive h3 for the title of a card, panel, list group or dialog section, between Subheading and body text in size. One size, no size prop. Pair with Text for the supporting line.

Installation

pnpm dlx shadcn@latest add @01orbital/title

Usage

import { Text } from "@/components/text/text"
import { Title } from "@/components/title/title"

const COPY = {
  title: "Quarterly planning",
  body: "Goals, owners and dates for the next twelve weeks, in one place.",
}

export default function TitleDemo() {
  return (
    <div className="grid max-w-sm gap-2 rounded-xl border bg-card p-6 text-card-foreground">
      <Title>{COPY.title}</Title>
      <Text variant="muted">{COPY.body}</Text>
    </div>
  )
}

This example installs with everything it uses:

pnpm dlx shadcn@latest add @01orbital/title-demo

API reference

The title of a card, panel or list group, rendered as an <h3> in the body font: 18px with a 28px line, 20px from the sm breakpoint, medium weight. One size, no props beyond the element's own; pass render to use another heading level. Inside a stock Card, use CardTitle; a section's heading is Subheading and a page's headline is Heading.

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

Dependencies

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

Used in blocks

3 blocks are built with Title:

Last updated on