Preformattedcomponent
Preformatted({ children, ...variants }: PreformattedProps): ReactElement| Param | Type | |
|---|---|---|
variants | PreformattedProps | Props for Preformatted — space, colour, typography, width, and padding variants plus a wrap toggle. required |
.wrap | boolean | 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
wrapto wrap long lines instead; newlines and indentation are preserved either way.
Examples
<Preformatted>{"line one\nline two"}</Preformatted>