Preformattedcomponent

Preformatted({ children, ...variants }: PreformattedProps): ReactElement
ParamType
variantsPreformattedProps
Props for Preformatted — space, colour, typography, width, and padding variants plus a wrap toggle. required
    .wrapboolean
Enable line wrapping (default is nowrap).
Return
ReactElement
Rendered <pre> element.

Preformatted block of text — rendered as <pre>.

  • Lines are not wrapped by default — overflowing content scrolls horizontally within the block.
  • Pass wrap to wrap long lines instead; newlines and indentation are preserved either way.

Examples

<Preformatted>{"line one\nline two"}</Preformatted>