Foundations

Rich-text styling wrapper for CMS-rendered semantic markup.

Install

npx shadcn@latest add @alix/prose

Preview

Usage

<Prose>
  <PortableText value={page.body} />
</Prose>

Examples

01

Lists, quotes, and tables

One wrapper styles the full tag set a CMS body emits: nested headings, ordered and unordered lists, inline marks, blockquotes, and tables.

<Prose>
  <h3>What the first review covers</h3>
  <p>The opening assessment separates <strong>liquidity</strong> from <em>solvency</em>.</p>
  <ol>
    <li>Thirteen-week cash position and covenant headroom.</li>
    <li>Operating model and the margin bridge behind it.</li>
  </ol>
  <table></table>
  <blockquote>
    Liquidity tells you where you are; the operating model tells you how you got there.
  </blockquote>
</Prose>
02

On a dark surface

Prose keys its links, quotes, and muted text to surface tokens, so dropping it into a navy Container remaps the whole tree for legibility.

<Container width="md" bgColor="primary" className="p-8">
  <Prose>
    <h3>Reading a cash crisis</h3>
    <p>The same styles carry onto the navy anchor. <a href="/insights">Links</a> remap too.</p>
    <blockquote>The decisions that stabilise a business are made in the first weeks.</blockquote>
  </Prose>
</Container>

When to use it

Use it for

  • Styling a CMS body field a renderer has already turned into bare semantic tags: Portable Text, a Contentful renderer, an HTML string.
  • As the rich-text fill for any ReactNode content slot, such as a SectionTitle description.
  • Long-form editorial bodies where headings, lists, quotes, and tables all need consistent, token-keyed styling.

Reach for something else

  • Individual headings or paragraphs you author yourself. Use the Text atom, which owns its element and level.
  • Parsing or rendering rich text. That stays in the consumer's CMS renderer; Prose only styles the output.
  • UI text inside controls. That is the control's own typography, never content prose.

Props

PropTypeDefaultDescription
childrenReactNodeA rendered rich-text tree of semantic tags; Prose styles it but never parses or renders CMS source data.

See also