Code
MockupCode renders a dark terminal-style block. Feed it lines — each with an
optional prompt prefix and colour — or supply your own <pre> elements as
children. It is also available as Mockup.Code.
Import
import { MockupCode } from '@sigx/daisyui';
// or
import { Mockup } from '@sigx/daisyui';
Basic Usage
Loading preview...
Multiple Lines with Colours
prefix is rendered as the line's gutter text; color tints the line with a
theme colour.
Loading preview...
Custom Children
When you pass children they replace lines entirely. Use data-prefix on
each <pre> for the gutter, and DaisyUI's bg-* / text-* classes to
highlight a whole line.
Loading preview...
Props
| Prop | Type | Default | Description |
|---|---|---|---|
lines | CodeLine[] | - | Lines to render when no children are given |
class | string | - | Additional CSS classes |
CodeLine
| Field | Type | Description |
|---|---|---|
prefix | string | Gutter text ($, >, a line number, …) |
text | string | Line content |
color | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error' | Text colour for the line |
Slots
| Slot | Description |
|---|---|
default | Custom <pre> lines; replaces lines when present |
