Prose
ProThe reading type. Wrap a document, CMS rich text, rendered Markdown or plain JSX, and its bare headings, lists, quotes, code and tables are typeset on Koala's tokens, with one size prop.
Installation#
Usage#
The preview is yours to explore. Its code comes with a Pro license, paid once and used in every project.
Have a license? Unlock it here
Sizes#
The size picks the type and the rhythm together. sm is the 14px body of the product UI (a comment, a task description, what a RichTextEditor wrote); md is docs and release notes; lg is long-form reading at 17px, for an article at a ~42rem measure.
Rich text from a CMS#
A CMS, a Markdown renderer or a Tiptap export hands you a string of bare HTML. Set it on Prose and it is typeset as it is: no class to add to the content.
Elements#
Ordered lists carry tabular markers, inline code keeps the global chip, a pre is a muted block that scrolls on its own, a table scrolls inside the column instead of the page, and a picture gets the corner radius and the image outline. Media take a wider step than copy, so they read as breaks.
Components inside#
Prose styles bare elements. An anchor or image that carries a class is a component, so it keeps its own look: a Link or a Button dropped into the copy is never underlined or restyled.
As child#
Pass asChild to put the styling on your own element, an article or a section, instead of a wrapping div.
The preview is yours to explore. Its code comes with a Pro license, paid once and used in every project.
Have a license? Unlock it here
API reference#
Prose
Typesets the bare elements under it (headings, lists, quotes, code, tables, media). Renders a <div> and forwards all native <div> props; accepts className, merged last, so a descendant utility like [&_h2]:text-brand wins over the recipe.
| Prop | Type | Default | Description |
|---|---|---|---|
| size | "sm" | "md" | "lg" | "md" | Type scale and rhythm: sm 14/24 for product UI, md 16/28 for docs and release notes, lg 17/28 for long-form articles. |
| asChild | boolean | false | Render the styling onto your own child element (<article>, <section>) instead of a div. |
| Data attribute | Description |
|---|---|
| data-size | The resolved size: "sm", "md" or "lg". |
| CSS variable | Description |
|---|---|
| --prose-flow | Gap between top-level blocks. Set by size. |
| --prose-h2 | Space above an h1 or h2. |
| --prose-h3 | Space above an h3 or h4. |
| --prose-after-heading | Space between a heading and the block it opens. |
| --prose-media | Space around figure, pre, table, hr, blockquote, video and iframe. |
| --prose-item | Gap between list items and before a nested list. |