Prose gives bare document elements a consistent reading measure, type hierarchy, spacing rhythm, and semantic color treatment. Wrap rendered Markdown, trusted CMS output, or plain JSX without adding classes to every heading, list, quote, code block, or table.
Constraints make systems easier to extend
Zenos components use semantic tokens so a theme can change without rewriting every component. Read the theme customization guide for the complete token map.
- Components consume semantic roles instead of literal colors.
- Spacing and typography follow a shared scale.
- Application-specific behavior stays outside generic UI.
A shared component should be easier to use correctly than rebuilding it locally.
Import the wrapper with import { Prose } from "@zentara-co/zenos-ui".
import { Prose } from "@zentara-co/zenos-ui";
Use as when the wrapper has document meaning. Zenos layout polymorphism uses as, so an article or section keeps its native props and ref type.
<Prose as="article" size="lg"> <h1>Release notes</h1> <p>Version 2.4 improves form density and keyboard behavior.</p></Prose>
The size changes body type, heading hierarchy, and block spacing as one reading system. The defaults follow a 14/24 body with a 16px block step at sm, 16/28 with a 20px step at md, and 17/28 with a 24px step at lg. Use sm for compact product descriptions and stored editor output, md for documentation and release notes, and lg for long-form articles.
SM reading scale
The type size and vertical rhythm move together while the document structure stays the same.
MD reading scale
The type size and vertical rhythm move together while the document structure stays the same.
LG reading scale
The type size and vertical rhythm move together while the document structure stays the same.
Prose styles bare headings, paragraphs, emphasis, links, ordered and unordered lists, blockquotes, inline code, preformatted blocks, tables, images, figures, descriptions, keyboard input, and separators. Its default reading measure is 42rem, the wrapper starts with no padding, and wide tables scroll inside that measure instead of expanding the page.
Elements that already carry a className keep their own component treatment. This lets Link, Button, CodeBlock, and other Zenos components sit inside Prose without being restyled as bare document content.
<Prose> <p> A bare <a href="/guide">document link</a> receives the prose treatment. </p> <Link href="/workspace">Open workspace</Link></Prose>
className is merged after the defaults, so ordinary utilities can replace the reading measure and wrapper padding. Use the typed --prose-* variables through style when descendant rhythm or padding needs to change without rewriting the selectors.
<Prose className="max-w-none p-6" style={{ "--prose-block-gap": "2rem", "--prose-list-indent": "2rem", "--prose-pre-padding": "1.5rem", }}> {content}</Prose>
Available spacing variables are --prose-block-gap, --prose-media-gap, --prose-list-indent, --prose-quote-padding, --prose-pre-padding, --prose-inline-code-padding-inline, --prose-inline-code-padding-block, --prose-cell-padding-inline, and --prose-cell-padding-block.
Prose only styles descendants; it does not parse or sanitize HTML. Sanitize untrusted CMS or user-authored HTML before passing it to React.
<Prose dangerouslySetInnerHTML={{ __html: sanitizedHtml }} />
Prose
API
| Prop | Type | Default | Description |
size | sm | md | lg | md | Selects the body type scale, heading scale, and vertical rhythm together. |
as | ElementType | div | Renders a semantic wrapper such as article or section. |
className | string | — | Extends the wrapper and descendant treatment with consumer-owned classes. |
style | ProseStyle | — | Overrides native wrapper styles and the documented --prose-* spacing variables. |
native props | React.HTMLAttributes<HTMLElement> | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props,
including className, style, aria-*, and data-*.
Use meaningful document structure inside Prose: keep heading levels ordered, give links descriptive text, include alternate text for informative images, and add table headers and captions where they help readers. Choose as="article" or as="section" only when that landmark has an accessible purpose. Prose changes presentation without replacing native semantics.