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
| Prop | Type | Default | Description |
|---|---|---|---|
as | ElementType | 'div' | The HTML element to render as. |
children | ReactNode | - | The content to render (string or array). |
className | string | - | Additional CSS classes. |
inline | boolean | false | Renders markdown inline (no paragraphs). |
lines | number | - | Limits the number of lines visible. |
mode | 'html' | 'markdown' | 'markdown' | The parsing mode for the content. |
placeholder | string | - | Text to show if children is empty. |
Last updated on