# Typography

Headings, paragraphs, quotes, lists and small print in the hand, with the pen rules drawn under and beside them.

Docs: https://ballpoint.st9wd.com/docs/typography

```bash
npx shadcn@latest add @ballpoint/typography
```

```tsx
import { TypographyH1, TypographyH2, TypographyP } from "@/components/ui/typography"

<TypographyH1>Field notes</TypographyH1>
<TypographyP>The first page of a new notebook.</TypographyP>
<TypographyH2>Materials</TypographyH2>
```

Props:

- `TypographyH1 … H4`: `h1 … h4`. Headings. H2 is ruled off with a pen line.
- `TypographyP`: `p`. Body text, with space above every paragraph but the first.
- `TypographyBlockquote`: `blockquote`. A quotation with a pen line drawn down its side.
- `TypographyList / InlineCode`: `ul / code`. A bulleted list, and a snippet of code in a line of text.
- `TypographyLead / Large / Small / Muted`: `p / div / small / p`. Introductory text, emphasis, fine print and quiet hints.

## Example

```tsx
import {
  TypographyBlockquote,
  TypographyH1,
  TypographyH2,
  TypographyH3,
  TypographyInlineCode,
  TypographyList,
  TypographyP,
} from "@/components/ui/typography";

export default function TypographyDemo() {
  return (
    <article className="flex w-full max-w-2xl flex-col gap-1">
      <TypographyH1>The Joke Tax Chronicles</TypographyH1>
      <TypographyP>
        Once upon a time, in a far-off land, there was a very lazy king who spent all day lounging on his throne. One day, his advisors came to him with a
        problem: the kingdom was running out of money.
      </TypographyP>
      <TypographyH2 className="mt-8">The King&apos;s Plan</TypographyH2>
      <TypographyP>
        The king thought long and hard, and finally came up with <TypographyInlineCode>a brilliant plan</TypographyInlineCode>: he would tax the jokes in the
        kingdom.
      </TypographyP>
      <TypographyBlockquote>&quot;After all,&quot; he said, &quot;everyone enjoys a good joke, so it&apos;s only fair that they should pay for the privilege.&quot;</TypographyBlockquote>
      <TypographyH3 className="mt-8">The Joke Tax</TypographyH3>
      <TypographyP>The king&apos;s subjects were not amused. They grumbled and complained, but the king was firm:</TypographyP>
      <TypographyList>
        <li>1st level of puns: 5 gold coins</li>
        <li>2nd level of jokes: 10 gold coins</li>
        <li>3rd level of one-liners: 20 gold coins</li>
      </TypographyList>
    </article>
  );
}
```

## Lead, large, small and muted

The quieter text styles for the margins of a page.

```tsx
import { TypographyLarge, TypographyLead, TypographyMuted, TypographySmall } from "@/components/ui/typography";

export default function TypographySmallText() {
  return (
    <div className="flex w-full max-w-lg flex-col gap-5">
      <TypographyLead>A modal dialog that interrupts the user with important content and expects a response.</TypographyLead>
      <TypographyLarge>Are you absolutely sure?</TypographyLarge>
      <TypographySmall>Email address</TypographySmall>
      <TypographyMuted>Enter your email address.</TypographyMuted>
    </div>
  );
}
```
