Skip to Content
Documentation
Getting startedComponentsChartsTheming
Get Pro
Overview
Concepts

Prose

Used to style remote HTML content, such as markdown or a CMS response, with the Saas UI typography language.

Title Heading 1

Title Heading 2

Title Heading 3

Title Heading 4 testing

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi at dolor nec ex rutrum semper. Praesent ultricies purus eget lectus tristique egestas ac in lacus. Press Ctrl + C to copy.


Fusce placerat ipsum vel sollicitudin imperdiet. Morbi vulputate non diam at consequat. Donec vitae sem eu arcu auctor scelerisque vel in turpis.

Anatomy

import { Prose } from '#components/ui/prose'
<Prose>
  <div dangerouslySetInnerHTML={{ __html: '...' }} />
</Prose>

Usage

Prose is a styled div that targets the raw HTML elements inside it — headings, paragraphs, lists, tables, code, blockquotes and more. Use it when you render content you don't control, like markdown, a rich text editor value, or HTML from a CMS, where you can't attach Chakra components to each node.

Content is constrained to 65ch by default for comfortable reading. Override it with the maxWidth prop when you need a wider column.

Examples

Sizes

Use the size prop to change the base font size of the content. All spacing is defined in em, so it scales with the size.

size: md

Title Heading 2

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi at dolor nec ex rutrum semper. Praesent ultricies purus eget lectus tristique egestas ac in lacus.

size: lg

Title Heading 2

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi at dolor nec ex rutrum semper. Praesent ultricies purus eget lectus tristique egestas ac in lacus.

Blockquote

Blockquote elements are styled to match the design language of the Blockquote component.

Blockquotes

This is a good looking blockquote!

And it can span into multiple lines:

Fusce placerat ipsum vel sollicitudin imperdiet. Morbi vulputate non diam at consequat. Donec vitae sem eu arcu auctor scelerisque vel in turpis.

There's also strong, b and em support as well.

List

List elements are styled to match the design language of the List component.

Lists

Let's look at some unordered lists. Things to buy:

  • Milk
  • Eggs
  • Bread
  • Saas UI Pro license

And some ordered lists. Things to do:

  1. Pay the bills
  2. Walk the dog
  3. Take out trash

Table

Table elements are styled to match the design language of the Table component.

Tables

Plan Seats Price
Starter 3 $0
Team 25 $49
Enterprise Unlimited Custom

React Markdown

Prose pairs well with a markdown renderer. Here's an example using react-markdown.

Heading

Based on your Saas UI plan. So click here to confirm your plan.

  • first item
  • second item
  • third item

Props

PropDefaultType
size 'md'
'md' | 'lg'

The base font size of the content. Spacing is defined in em, so it scales along.

maxWidth '65ch'
SystemStyleObject['maxWidth']

The maximum width of the content column.

children
React.ReactNode

The HTML content to style. Can also be set with dangerouslySetInnerHTML.

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

For more details, read our Composition guide.

Previous

Mark

Next

Text