Skip to Content
EnComponentsRich text

RichText

The RichText component is used to render HTML or Markdown content.

Playground

Props

Examples

Truncated Text

Use the lines prop to limit the number of lines displayed.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.

Props

PropTypeDefaultDescription
asElementType'div'The HTML element to render as.
childrenReactNode-The content to render (string or array).
classNamestring-Additional CSS classes.
inlinebooleanfalseRenders markdown inline (no paragraphs).
linesnumber-Limits the number of lines visible.
mode'html' | 'markdown''markdown'The parsing mode for the content.
placeholderstring-Text to show if children is empty.
Last updated on