Preview

Use Preview for component examples where readers need to see the rendered result and the source code together.

Usage

<Preview lang="html">
  <button type="button" class="btn">Save changes</button>
</Preview>

Options

PropTypeDefaultNotes
codestringGenerated from childrenOptional source override for the code tab.
langstring"html"Language passed to Shiki.
titlestringundefinedLabel for the preview tab.
classstring""Extra classes applied to the preview canvas.

Examples

Button

Custom title

Configuration

The source remains available from the Code tab.