Design›Preview

design

Preview

Component showcase with theme toggle and responsive viewports

Install

  1. Add the package: npm install @refrakt-md/design
  2. Add it to the plugins array in refrakt.config.json: "plugins": ["@refrakt-md/design"]

About the plugin and its runes

Source

import Markdoc from '@markdoc/markdoc';
import type { Node, RenderableTreeNode } from '@markdoc/markdoc';
const { Tag } = Markdoc;
import { createComponentRenderable, createContentModelSchema, asNodes } from '@refrakt-md/runes';
import { RenderableNodeCursor } from '@refrakt-md/runes';

function dedent(text: string): string {
	const lines = text.split('\n');
	const indents = lines
		.filter((l) => l.trim().length > 0)
		.map((l) => l.match(/^(\s*)/)?.[0].length ?? 0);
	const min = indents.length > 0 ? Math.min(...indents) : 0;
	return min > 0 ? lines.map((l) => l.slice(min)).join('\n') : text;
}

const VOID_ELEMENTS = new Set([
	'area',
	'base',
	'br',
	'col',
	'embed',
	'hr',
	'img',
	'input',
	'link',
	'meta',
	'param',
	'source',
	'track',
	'wbr',
]);

function escapeHtml(s: string): string {
	return s
		.replace(/&/g, '&')
		.replace(/</g, '&lt;')
		.replace(/>/g, '&gt;')
		.replace(/"/g, '&quot;');
}

function renderRuneHtml(nodes: Markdoc.RenderableTreeNode[], depth = 0): string {
	const indent = '  ';
	const lines: string[] = [];

	for (const node of nodes) {
		if (node === null || node === undefined) continue;
		if (typeof node === 'string') {
			const trimmed = node.trim();
			if (trimmed) lines.push(indent.repeat(depth) + escapeHtml(trimmed));
			continue;
		}
		if (typeof node === 'number') {
			lines.push(indent.repeat(depth) + String(node));
			continue;
		}
		if (!Tag.isTag(node)) continue;

		const { name, attributes, children = [] } = node;
		if (!name) {
			lines.push(renderRuneHtml(children, depth));
			continue;
		}

		const attrParts: string[] = [];
		for (const [k, v] of Object.entries(attributes ?? {})) {
			if (k === '$$mdtype') continue;
			if (v === undefined || v === null || v === false) continue;
			if (v === true) {
				attrParts.push(k);
				continue;
			}
			attrParts.push(`${k}="${escapeHtml(String(v))}"`);
		}
		const attrStr = attrParts.length ? ' ' + attrParts.join(' ') : '';
		const pad = indent.repeat(depth);

		if (VOID_ELEMENTS.has(name)) {
			lines.push(`${pad}<${name}${attrStr}>`);
			continue;
		}

		const allText = children.every(
			(c: Markdoc.RenderableTreeNode) => typeof c === 'string' || typeof c === 'number',
		);
		if (allText && children.length <= 1) {
			const text = children
				.map((c: Markdoc.RenderableTreeNode) =>
					typeof c === 'string' ? escapeHtml(c) : String(c ?? ''),
				)
				.join('');
			lines.push(`${pad}<${name}${attrStr}>${text}</${name}>`);
			continue;
		}

		lines.push(`${pad}<${name}${attrStr}>`);
		const inner = renderRuneHtml(children, depth + 1);
		if (inner) lines.push(inner);
		lines.push(`${pad}</${name}>`);
	}

	return lines.join('\n');
}

/**
 * The index of the fence shown as the preview's source, or -1. A fence the
 * author wrote is always the source. A snippet's fence is the source only
 * beside other content (a sandbox, say); alone, it is the content.
 */
function sourceFenceIndex(nodes: Node[]): number {
	return nodes.findIndex(
		(node) =>
			node.type === 'fence' &&
			(node.attributes.snippet !== true || nodes.some((other) => other !== node)),
	);
}

function extractFence(children: unknown[]): { fence: Node | undefined; rest: unknown[] } {
	const nodes = children as Node[];
	const fenceIdx = sourceFenceIndex(nodes);
	if (fenceIdx === -1) return { fence: undefined, rest: nodes };
	const fence = nodes[fenceIdx];
	return { fence, rest: [...nodes.slice(0, fenceIdx), ...nodes.slice(fenceIdx + 1)] };
}

export const preview = createContentModelSchema({
	attributes: {
		title: {
			type: String,
			required: false,
			description: 'Label shown in the preview card header.',
		},
		theme: {
			type: String,
			required: false,
			matches: ['auto', 'light', 'dark'],
			description:
				'Background theme for the preview viewport: auto follows the page, light/dark forces a mode.',
		},
		source: {
			type: Boolean,
			required: false,
			description: 'Enable/disable showing the source code panel alongside the rendered preview.',
		},
		responsive: {
			type: String,
			required: false,
			description:
				'Comma-separated viewport presets (e.g. "mobile,tablet,desktop") for responsive preview frames. Accepts mobile (375px), tablet (768px), and desktop (full); other values are ignored.',
		},
	},
	contentModel: {
		type: 'custom',
		processChildren: (nodes, attributes) => {
			const { fence, rest } = extractFence(nodes);
			if (fence) return [...rest, fence];
			return rest;
		},
		description:
			'Extracts fence blocks for source display, passes remaining children for preview rendering.',
	},
	transform(resolved, attrs, config, node) {
		const title = attrs.title ?? '';
		const theme = attrs.theme ?? 'auto';
		const showSource = attrs.source ?? false;
		const responsive = attrs.responsive ?? '';

		const allChildren = asNodes(resolved.children);

		let sourcePre: Markdoc.Tag<'pre'> | undefined;
		const fenceIdx = sourceFenceIndex(allChildren);
		let contentChildren: Node[];
		if (fenceIdx !== -1) {
			const fence = allChildren[fenceIdx];
			contentChildren = [...allChildren.slice(0, fenceIdx), ...allChildren.slice(fenceIdx + 1)];
			const lang = fence.attributes.language || 'shell';
			sourcePre = new Tag('pre', { 'data-language': lang }, [
				new Tag('code', { 'data-language': lang }, [fence.attributes.content]),
			]) as Markdoc.Tag<'pre'>;
		} else {
			contentChildren = allChildren;
		}

		if (!sourcePre && showSource) {
			const raw = config.variables?.__source;
			if (typeof raw === 'string' && node.lines?.length >= 2) {
				const allLines = raw.split('\n');
				const start = node.lines[0] + 1;
				const end = node.lines[node.lines.length - 1] - 1;
				const childSource = dedent(
					allLines
						.slice(start, end)
						.join('\n')
						.replace(/^(?:[ \t]*\n)+/, '')
						.trimEnd(),
				);
				if (childSource) {
					sourcePre = new Tag('pre', { 'data-language': 'markdoc' }, [
						new Tag('code', { 'data-language': 'markdoc' }, [childSource]),
					]) as Markdoc.Tag<'pre'>;
				}
			}
		}

		const children = new RenderableNodeCursor(
			Markdoc.transform(contentChildren, config) as RenderableTreeNode[],
		);

		let htmlSourcePre: Markdoc.Tag<'pre'> | undefined;
		if (sourcePre) {
			const htmlString = renderRuneHtml(children.toArray());
			if (htmlString) {
				htmlSourcePre = new Tag('pre', { 'data-language': 'html' }, [
					new Tag('code', { 'data-language': 'html' }, [htmlString]),
				]) as Markdoc.Tag<'pre'>;
			}
		}

		const titleMeta = title ? new Tag('meta', { content: title }) : undefined;
		const themeMeta = new Tag('meta', { content: theme });
		const responsiveMeta = responsive ? new Tag('meta', { content: responsive }) : undefined;

		const childNodes = [
			...(sourcePre ? [sourcePre] : []),
			...(htmlSourcePre ? [htmlSourcePre] : []),
			...children.toArray(),
		];

		return createComponentRenderable({
			rune: 'preview',
			tag: 'div',
			properties: {
				title: titleMeta,
				theme: themeMeta,
				responsive: responsiveMeta,
			},
			refs: {
				source: sourcePre,
				'html-source': htmlSourcePre,
			},
			children: childNodes,
		});
	},
});

View plugins/design/src/tags/preview.ts on GitHub

A component showcase wrapper that renders content in a framed environment with a theme toggle toolbar and responsive viewport simulation. Useful for documentation sites, design systems, and theme demonstrations.

Basic usage

Wrap content in {% preview %} … {% /preview %} to give it a frame with a theme toggle. With source=true, the Markdoc you wrote is shown beside it, as in every example on this site:

{% hint type="note" %}
Prices include VAT. Shipping is calculated at checkout.
{% /hint %}
<section data-rune="hint" data-rune-fields="{&quot;hintType&quot;:&quot;note&quot;}">
  <div data-name="body">
    <p>Prices include VAT. Shipping is calculated at checkout.</p>
  </div>
</section>
note

Prices include VAT. Shipping is calculated at checkout.

<section class="rf-hint rf-hint--note" data-hint-type="note" data-elevation="sunken" data-rune="hint" data-density="compact">
  <div data-name="header" data-zone="header" data-zone-layout="bar" class="rf-hint__header" data-section="header">
    <span data-field="hintType">
      <span data-icon-group="hint" data-icon="note"></span>
      <span data-meta-value="">note</span>
    </span>
  </div>
  <div data-name="body" class="rf-hint__body">
    <p>Prices include VAT. Shipping is calculated at checkout.</p>
  </div>
</section>

How Markdown is read

You writeIt becomes
The first fenced code blockThe source shown in the code view; it is not rendered in the canvas
A {% snippet %} beside other contentThe source, read from the file
A {% snippet %} on its ownThe rendered content; with source=true, the code view shows the tag
Everything elseThe rendered content inside the frame

Theme modes

The toolbar toggle lets users switch between auto (system preference), light, and dark modes. The theme attribute sets the initial mode; this preview is written {% preview theme="dark" source=true %}:

{% hint type="check" %}
Your order has shipped. Track it from your account page.
{% /hint %}
<section data-rune="hint" data-rune-fields="{&quot;hintType&quot;:&quot;check&quot;}">
  <div data-name="body">
    <p>Your order has shipped. Track it from your account page.</p>
  </div>
</section>
check

Your order has shipped. Track it from your account page.

<section class="rf-hint rf-hint--check" data-hint-type="check" data-elevation="sunken" data-rune="hint" data-density="compact">
  <div data-name="header" data-zone="header" data-zone-layout="bar" class="rf-hint__header" data-section="header">
    <span data-field="hintType">
      <span data-icon-group="hint" data-icon="check"></span>
      <span data-meta-value="">check</span>
    </span>
  </div>
  <div data-name="body" class="rf-hint__body">
    <p>Your order has shipped. Track it from your account page.</p>
  </div>
</section>

The theme toggle scopes CSS custom properties to the preview canvas, so child content inherits the selected theme without affecting the rest of the page.

Responsive viewports

The responsive attribute adds a viewport simulation toolbar that lets users switch between device sizes. Specify a comma-separated list of presets: mobile (375px), tablet (768px), desktop (full width). This preview is written {% preview source=true responsive="mobile,tablet,desktop" %}:

{% hint type="warning" %}
Checkout closes at midnight. Orders placed after that ship on Monday.
{% /hint %}
<section data-rune="hint" data-rune-fields="{&quot;hintType&quot;:&quot;warning&quot;}">
  <div data-name="body">
    <p>Checkout closes at midnight. Orders placed after that ship on Monday.</p>
  </div>
</section>
warning

Checkout closes at midnight. Orders placed after that ship on Monday.

<section class="rf-hint rf-hint--warning" data-hint-type="warning" data-elevation="sunken" data-rune="hint" data-density="compact">
  <div data-name="header" data-zone="header" data-zone-layout="bar" class="rf-hint__header" data-section="header">
    <span data-field="hintType">
      <span data-icon-group="hint" data-icon="warning"></span>
      <span data-meta-value="">warning</span>
    </span>
  </div>
  <div data-name="body" class="rf-hint__body">
    <p>Checkout closes at midnight. Orders placed after that ship on Monday.</p>
  </div>
</section>

The preview starts at the last preset in the list (desktop above). Switching viewports wraps the canvas in a constrained frame with a dashed border and a width label. Any subset of presets works: responsive="mobile,tablet" offers no desktop option.

Source code toggle

The preview rune supports two ways to show source code alongside rendered output.

Auto-inferred source

Add source=true to extract the children's Markdoc text as the code view, as most examples on this page do. No duplication needed — the preview infers the source from what it renders. This is ideal for Markdoc documentation sites where the preview content IS the source code.

Explicit source

Add a fenced code block as a direct child for full control over what the code view shows. The fence can be in any language — JSX, Vue, HTML, or Markdoc. This is useful when documenting external frameworks where the source differs from the rendered preview:

<ProfileCard
  name="Sarah Johnson"
  handle="sarahjohnson"
  bio="Product designer passionate about crafting delightful user experiences."
/>
<rf-sandbox data-rune="sandbox" data-source-content="&lt;div data-source=&quot;HTML&quot;&gt;
&lt;div class=&quot;min-h-screen bg-[#f5f4f1] dark:bg-[#1a1a17] flex items-center justify-center p-6&quot;&gt;
  &lt;div class=&quot;bg-[#fbfaf7] dark:bg-[#211f1c] rounded-2xl shadow-xl max-w-sm w-full overflow-hidden transition-colors&quot;&gt;
    &lt;!-- Cover Image --&gt;
    &lt;div class=&quot;h-32 bg-gradient-to-r from-[#e15f80] to-[#c4501c] dark:from-[#e8788f] dark:to-[#e87a3a]&quot;&gt;&lt;/div&gt;

    &lt;!-- Profile Content --&gt;
    &lt;div class=&quot;relative px-6 pb-6&quot;&gt;
      &lt;!-- Avatar --&gt;
      &lt;div class=&quot;flex justify-center -mt-16 mb-4&quot;&gt;
        &lt;img
          src=&quot;https://i.pravatar.cc/120?img=32&quot;
          alt=&quot;Profile&quot;
          class=&quot;w-32 h-32 rounded-full border-4 border-[#fbfaf7] dark:border-[#211f1c] shadow-lg&quot;
        /&gt;
      &lt;/div&gt;

      &lt;!-- User Info --&gt;
      &lt;div class=&quot;text-center mb-6&quot;&gt;
        &lt;h2 class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef] mb-1&quot;&gt;Sarah Johnson&lt;/h2&gt;
        &lt;p class=&quot;text-[#6b6661] dark:text-[#94908a] text-sm mb-3&quot;&gt;@sarahjohnson&lt;/p&gt;
        &lt;p class=&quot;text-[#1c1a17]/80 dark:text-[#f6f4ef]/80 leading-relaxed&quot;&gt;
          Product designer passionate about crafting delightful user experiences.
          Coffee enthusiast ☕️
        &lt;/p&gt;
      &lt;/div&gt;

      &lt;!-- Stats --&gt;
      &lt;div class=&quot;flex justify-around py-4 border-y border-[#e2e0dd] dark:border-[#2a2825] mb-6&quot;&gt;
        &lt;div class=&quot;text-center&quot;&gt;
          &lt;div class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef]&quot;&gt;1.2k&lt;/div&gt;
          &lt;div class=&quot;text-xs text-[#6b6661] dark:text-[#94908a] uppercase tracking-wide&quot;&gt;Followers&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;text-center&quot;&gt;
          &lt;div class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef]&quot;&gt;842&lt;/div&gt;
          &lt;div class=&quot;text-xs text-[#6b6661] dark:text-[#94908a] uppercase tracking-wide&quot;&gt;Following&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;text-center&quot;&gt;
          &lt;div class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef]&quot;&gt;94&lt;/div&gt;
          &lt;div class=&quot;text-xs text-[#6b6661] dark:text-[#94908a] uppercase tracking-wide&quot;&gt;Posts&lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;!-- Action Buttons --&gt;
      &lt;div class=&quot;flex gap-3&quot;&gt;
        &lt;button class=&quot;flex-1 bg-gradient-to-r from-[#e15f80] to-[#c84a6c] dark:from-[#e8788f] dark:to-[#ef91a3] text-white font-semibold py-3 rounded-xl hover:from-[#c84a6c] hover:to-[#b35070] dark:hover:from-[#ef91a3] dark:hover:to-[#e89db0] transition-all shadow-lg shadow-[#e15f80]/30 dark:shadow-[#e8788f]/20&quot;&gt;
          Follow
        &lt;/button&gt;
        &lt;button class=&quot;flex-1 border-2 border-[#e2e0dd] dark:border-[#2a2825] text-[#1c1a17] dark:text-[#f6f4ef] font-semibold py-3 rounded-xl hover:bg-[#ecebe8] dark:hover:bg-[#2a2825] transition-all&quot;&gt;
          Message
        &lt;/button&gt;
      &lt;/div&gt;

      &lt;!-- Social Links --&gt;
      &lt;div class=&quot;flex justify-center gap-4 mt-6&quot;&gt;
        &lt;a href=&quot;#&quot; class=&quot;w-10 h-10 flex items-center justify-center rounded-full bg-[#ecebe8] dark:bg-[#2a2825] text-[#6b6661] dark:text-[#94908a] hover:bg-[#e15f80]/20 dark:hover:bg-[#e8788f]/20 hover:text-[#e15f80] dark:hover:text-[#e8788f] transition-all&quot;&gt;
          &lt;svg class=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V12h2.54V9.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V12h2.773l-.443 2.89h-2.33v6.988C18.343 21.128 22 16.991 22 12z&quot;/&gt;&lt;/svg&gt;
        &lt;/a&gt;
        &lt;a href=&quot;#&quot; class=&quot;w-10 h-10 flex items-center justify-center rounded-full bg-[#ecebe8] dark:bg-[#2a2825] text-[#6b6661] dark:text-[#94908a] hover:bg-[#e15f80]/20 dark:hover:bg-[#e8788f]/20 hover:text-[#e15f80] dark:hover:text-[#e8788f] transition-all&quot;&gt;
          &lt;svg class=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84&quot;/&gt;&lt;/svg&gt;
        &lt;/a&gt;
        &lt;a href=&quot;#&quot; class=&quot;w-10 h-10 flex items-center justify-center rounded-full bg-[#ecebe8] dark:bg-[#2a2825] text-[#6b6661] dark:text-[#94908a] hover:bg-[#e15f80]/20 dark:hover:bg-[#e8788f]/20 hover:text-[#e15f80] dark:hover:text-[#e8788f] transition-all&quot;&gt;
          &lt;svg class=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z&quot;/&gt;&lt;/svg&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;" data-height="auto" data-source-origins="HTML	profile-card/index.html" data-security-mode="trusted" data-allow-js="true">
  <template data-content="fallback">
    <pre data-language="html">
      <code data-language="html">&lt;div data-source=&quot;HTML&quot;&gt;
&lt;div class=&quot;min-h-screen bg-[#f5f4f1] dark:bg-[#1a1a17] flex items-center justify-center p-6&quot;&gt;
  &lt;div class=&quot;bg-[#fbfaf7] dark:bg-[#211f1c] rounded-2xl shadow-xl max-w-sm w-full overflow-hidden transition-colors&quot;&gt;
    &lt;!-- Cover Image --&gt;
    &lt;div class=&quot;h-32 bg-gradient-to-r from-[#e15f80] to-[#c4501c] dark:from-[#e8788f] dark:to-[#e87a3a]&quot;&gt;&lt;/div&gt;

    &lt;!-- Profile Content --&gt;
    &lt;div class=&quot;relative px-6 pb-6&quot;&gt;
      &lt;!-- Avatar --&gt;
      &lt;div class=&quot;flex justify-center -mt-16 mb-4&quot;&gt;
        &lt;img
          src=&quot;https://i.pravatar.cc/120?img=32&quot;
          alt=&quot;Profile&quot;
          class=&quot;w-32 h-32 rounded-full border-4 border-[#fbfaf7] dark:border-[#211f1c] shadow-lg&quot;
        /&gt;
      &lt;/div&gt;

      &lt;!-- User Info --&gt;
      &lt;div class=&quot;text-center mb-6&quot;&gt;
        &lt;h2 class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef] mb-1&quot;&gt;Sarah Johnson&lt;/h2&gt;
        &lt;p class=&quot;text-[#6b6661] dark:text-[#94908a] text-sm mb-3&quot;&gt;@sarahjohnson&lt;/p&gt;
        &lt;p class=&quot;text-[#1c1a17]/80 dark:text-[#f6f4ef]/80 leading-relaxed&quot;&gt;
          Product designer passionate about crafting delightful user experiences.
          Coffee enthusiast ☕️
        &lt;/p&gt;
      &lt;/div&gt;

      &lt;!-- Stats --&gt;
      &lt;div class=&quot;flex justify-around py-4 border-y border-[#e2e0dd] dark:border-[#2a2825] mb-6&quot;&gt;
        &lt;div class=&quot;text-center&quot;&gt;
          &lt;div class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef]&quot;&gt;1.2k&lt;/div&gt;
          &lt;div class=&quot;text-xs text-[#6b6661] dark:text-[#94908a] uppercase tracking-wide&quot;&gt;Followers&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;text-center&quot;&gt;
          &lt;div class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef]&quot;&gt;842&lt;/div&gt;
          &lt;div class=&quot;text-xs text-[#6b6661] dark:text-[#94908a] uppercase tracking-wide&quot;&gt;Following&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;text-center&quot;&gt;
          &lt;div class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef]&quot;&gt;94&lt;/div&gt;
          &lt;div class=&quot;text-xs text-[#6b6661] dark:text-[#94908a] uppercase tracking-wide&quot;&gt;Posts&lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;!-- Action Buttons --&gt;
      &lt;div class=&quot;flex gap-3&quot;&gt;
        &lt;button class=&quot;flex-1 bg-gradient-to-r from-[#e15f80] to-[#c84a6c] dark:from-[#e8788f] dark:to-[#ef91a3] text-white font-semibold py-3 rounded-xl hover:from-[#c84a6c] hover:to-[#b35070] dark:hover:from-[#ef91a3] dark:hover:to-[#e89db0] transition-all shadow-lg shadow-[#e15f80]/30 dark:shadow-[#e8788f]/20&quot;&gt;
          Follow
        &lt;/button&gt;
        &lt;button class=&quot;flex-1 border-2 border-[#e2e0dd] dark:border-[#2a2825] text-[#1c1a17] dark:text-[#f6f4ef] font-semibold py-3 rounded-xl hover:bg-[#ecebe8] dark:hover:bg-[#2a2825] transition-all&quot;&gt;
          Message
        &lt;/button&gt;
      &lt;/div&gt;

      &lt;!-- Social Links --&gt;
      &lt;div class=&quot;flex justify-center gap-4 mt-6&quot;&gt;
        &lt;a href=&quot;#&quot; class=&quot;w-10 h-10 flex items-center justify-center rounded-full bg-[#ecebe8] dark:bg-[#2a2825] text-[#6b6661] dark:text-[#94908a] hover:bg-[#e15f80]/20 dark:hover:bg-[#e8788f]/20 hover:text-[#e15f80] dark:hover:text-[#e8788f] transition-all&quot;&gt;
          &lt;svg class=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V12h2.54V9.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V12h2.773l-.443 2.89h-2.33v6.988C18.343 21.128 22 16.991 22 12z&quot;/&gt;&lt;/svg&gt;
        &lt;/a&gt;
        &lt;a href=&quot;#&quot; class=&quot;w-10 h-10 flex items-center justify-center rounded-full bg-[#ecebe8] dark:bg-[#2a2825] text-[#6b6661] dark:text-[#94908a] hover:bg-[#e15f80]/20 dark:hover:bg-[#e8788f]/20 hover:text-[#e15f80] dark:hover:text-[#e8788f] transition-all&quot;&gt;
          &lt;svg class=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84&quot;/&gt;&lt;/svg&gt;
        &lt;/a&gt;
        &lt;a href=&quot;#&quot; class=&quot;w-10 h-10 flex items-center justify-center rounded-full bg-[#ecebe8] dark:bg-[#2a2825] text-[#6b6661] dark:text-[#94908a] hover:bg-[#e15f80]/20 dark:hover:bg-[#e8788f]/20 hover:text-[#e15f80] dark:hover:text-[#e8788f] transition-all&quot;&gt;
          &lt;svg class=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z&quot;/&gt;&lt;/svg&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;</code>
    </pre>
  </template>
  <template data-content="source">&lt;div data-source=&quot;HTML&quot;&gt;
&lt;div class=&quot;min-h-screen bg-[#f5f4f1] dark:bg-[#1a1a17] flex items-center justify-center p-6&quot;&gt;
  &lt;div class=&quot;bg-[#fbfaf7] dark:bg-[#211f1c] rounded-2xl shadow-xl max-w-sm w-full overflow-hidden transition-colors&quot;&gt;
    &lt;!-- Cover Image --&gt;
    &lt;div class=&quot;h-32 bg-gradient-to-r from-[#e15f80] to-[#c4501c] dark:from-[#e8788f] dark:to-[#e87a3a]&quot;&gt;&lt;/div&gt;

    &lt;!-- Profile Content --&gt;
    &lt;div class=&quot;relative px-6 pb-6&quot;&gt;
      &lt;!-- Avatar --&gt;
      &lt;div class=&quot;flex justify-center -mt-16 mb-4&quot;&gt;
        &lt;img
          src=&quot;https://i.pravatar.cc/120?img=32&quot;
          alt=&quot;Profile&quot;
          class=&quot;w-32 h-32 rounded-full border-4 border-[#fbfaf7] dark:border-[#211f1c] shadow-lg&quot;
        /&gt;
      &lt;/div&gt;

      &lt;!-- User Info --&gt;
      &lt;div class=&quot;text-center mb-6&quot;&gt;
        &lt;h2 class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef] mb-1&quot;&gt;Sarah Johnson&lt;/h2&gt;
        &lt;p class=&quot;text-[#6b6661] dark:text-[#94908a] text-sm mb-3&quot;&gt;@sarahjohnson&lt;/p&gt;
        &lt;p class=&quot;text-[#1c1a17]/80 dark:text-[#f6f4ef]/80 leading-relaxed&quot;&gt;
          Product designer passionate about crafting delightful user experiences.
          Coffee enthusiast ☕️
        &lt;/p&gt;
      &lt;/div&gt;

      &lt;!-- Stats --&gt;
      &lt;div class=&quot;flex justify-around py-4 border-y border-[#e2e0dd] dark:border-[#2a2825] mb-6&quot;&gt;
        &lt;div class=&quot;text-center&quot;&gt;
          &lt;div class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef]&quot;&gt;1.2k&lt;/div&gt;
          &lt;div class=&quot;text-xs text-[#6b6661] dark:text-[#94908a] uppercase tracking-wide&quot;&gt;Followers&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;text-center&quot;&gt;
          &lt;div class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef]&quot;&gt;842&lt;/div&gt;
          &lt;div class=&quot;text-xs text-[#6b6661] dark:text-[#94908a] uppercase tracking-wide&quot;&gt;Following&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;text-center&quot;&gt;
          &lt;div class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef]&quot;&gt;94&lt;/div&gt;
          &lt;div class=&quot;text-xs text-[#6b6661] dark:text-[#94908a] uppercase tracking-wide&quot;&gt;Posts&lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;!-- Action Buttons --&gt;
      &lt;div class=&quot;flex gap-3&quot;&gt;
        &lt;button class=&quot;flex-1 bg-gradient-to-r from-[#e15f80] to-[#c84a6c] dark:from-[#e8788f] dark:to-[#ef91a3] text-white font-semibold py-3 rounded-xl hover:from-[#c84a6c] hover:to-[#b35070] dark:hover:from-[#ef91a3] dark:hover:to-[#e89db0] transition-all shadow-lg shadow-[#e15f80]/30 dark:shadow-[#e8788f]/20&quot;&gt;
          Follow
        &lt;/button&gt;
        &lt;button class=&quot;flex-1 border-2 border-[#e2e0dd] dark:border-[#2a2825] text-[#1c1a17] dark:text-[#f6f4ef] font-semibold py-3 rounded-xl hover:bg-[#ecebe8] dark:hover:bg-[#2a2825] transition-all&quot;&gt;
          Message
        &lt;/button&gt;
      &lt;/div&gt;

      &lt;!-- Social Links --&gt;
      &lt;div class=&quot;flex justify-center gap-4 mt-6&quot;&gt;
        &lt;a href=&quot;#&quot; class=&quot;w-10 h-10 flex items-center justify-center rounded-full bg-[#ecebe8] dark:bg-[#2a2825] text-[#6b6661] dark:text-[#94908a] hover:bg-[#e15f80]/20 dark:hover:bg-[#e8788f]/20 hover:text-[#e15f80] dark:hover:text-[#e8788f] transition-all&quot;&gt;
          &lt;svg class=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V12h2.54V9.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V12h2.773l-.443 2.89h-2.33v6.988C18.343 21.128 22 16.991 22 12z&quot;/&gt;&lt;/svg&gt;
        &lt;/a&gt;
        &lt;a href=&quot;#&quot; class=&quot;w-10 h-10 flex items-center justify-center rounded-full bg-[#ecebe8] dark:bg-[#2a2825] text-[#6b6661] dark:text-[#94908a] hover:bg-[#e15f80]/20 dark:hover:bg-[#e8788f]/20 hover:text-[#e15f80] dark:hover:text-[#e8788f] transition-all&quot;&gt;
          &lt;svg class=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84&quot;/&gt;&lt;/svg&gt;
        &lt;/a&gt;
        &lt;a href=&quot;#&quot; class=&quot;w-10 h-10 flex items-center justify-center rounded-full bg-[#ecebe8] dark:bg-[#2a2825] text-[#6b6661] dark:text-[#94908a] hover:bg-[#e15f80]/20 dark:hover:bg-[#e8788f]/20 hover:text-[#e15f80] dark:hover:text-[#e8788f] transition-all&quot;&gt;
          &lt;svg class=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z&quot;/&gt;&lt;/svg&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;</template>
</rf-sandbox>
<rf-sandbox class="rf-sandbox" data-source-content="&lt;div data-source=&quot;HTML&quot;&gt;
&lt;div class=&quot;min-h-screen bg-[#f5f4f1] dark:bg-[#1a1a17] flex items-center justify-center p-6&quot;&gt;
  &lt;div class=&quot;bg-[#fbfaf7] dark:bg-[#211f1c] rounded-2xl shadow-xl max-w-sm w-full overflow-hidden transition-colors&quot;&gt;
    &lt;!-- Cover Image --&gt;
    &lt;div class=&quot;h-32 bg-gradient-to-r from-[#e15f80] to-[#c4501c] dark:from-[#e8788f] dark:to-[#e87a3a]&quot;&gt;&lt;/div&gt;

    &lt;!-- Profile Content --&gt;
    &lt;div class=&quot;relative px-6 pb-6&quot;&gt;
      &lt;!-- Avatar --&gt;
      &lt;div class=&quot;flex justify-center -mt-16 mb-4&quot;&gt;
        &lt;img
          src=&quot;https://i.pravatar.cc/120?img=32&quot;
          alt=&quot;Profile&quot;
          class=&quot;w-32 h-32 rounded-full border-4 border-[#fbfaf7] dark:border-[#211f1c] shadow-lg&quot;
        /&gt;
      &lt;/div&gt;

      &lt;!-- User Info --&gt;
      &lt;div class=&quot;text-center mb-6&quot;&gt;
        &lt;h2 class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef] mb-1&quot;&gt;Sarah Johnson&lt;/h2&gt;
        &lt;p class=&quot;text-[#6b6661] dark:text-[#94908a] text-sm mb-3&quot;&gt;@sarahjohnson&lt;/p&gt;
        &lt;p class=&quot;text-[#1c1a17]/80 dark:text-[#f6f4ef]/80 leading-relaxed&quot;&gt;
          Product designer passionate about crafting delightful user experiences.
          Coffee enthusiast ☕️
        &lt;/p&gt;
      &lt;/div&gt;

      &lt;!-- Stats --&gt;
      &lt;div class=&quot;flex justify-around py-4 border-y border-[#e2e0dd] dark:border-[#2a2825] mb-6&quot;&gt;
        &lt;div class=&quot;text-center&quot;&gt;
          &lt;div class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef]&quot;&gt;1.2k&lt;/div&gt;
          &lt;div class=&quot;text-xs text-[#6b6661] dark:text-[#94908a] uppercase tracking-wide&quot;&gt;Followers&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;text-center&quot;&gt;
          &lt;div class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef]&quot;&gt;842&lt;/div&gt;
          &lt;div class=&quot;text-xs text-[#6b6661] dark:text-[#94908a] uppercase tracking-wide&quot;&gt;Following&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;text-center&quot;&gt;
          &lt;div class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef]&quot;&gt;94&lt;/div&gt;
          &lt;div class=&quot;text-xs text-[#6b6661] dark:text-[#94908a] uppercase tracking-wide&quot;&gt;Posts&lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;!-- Action Buttons --&gt;
      &lt;div class=&quot;flex gap-3&quot;&gt;
        &lt;button class=&quot;flex-1 bg-gradient-to-r from-[#e15f80] to-[#c84a6c] dark:from-[#e8788f] dark:to-[#ef91a3] text-white font-semibold py-3 rounded-xl hover:from-[#c84a6c] hover:to-[#b35070] dark:hover:from-[#ef91a3] dark:hover:to-[#e89db0] transition-all shadow-lg shadow-[#e15f80]/30 dark:shadow-[#e8788f]/20&quot;&gt;
          Follow
        &lt;/button&gt;
        &lt;button class=&quot;flex-1 border-2 border-[#e2e0dd] dark:border-[#2a2825] text-[#1c1a17] dark:text-[#f6f4ef] font-semibold py-3 rounded-xl hover:bg-[#ecebe8] dark:hover:bg-[#2a2825] transition-all&quot;&gt;
          Message
        &lt;/button&gt;
      &lt;/div&gt;

      &lt;!-- Social Links --&gt;
      &lt;div class=&quot;flex justify-center gap-4 mt-6&quot;&gt;
        &lt;a href=&quot;#&quot; class=&quot;w-10 h-10 flex items-center justify-center rounded-full bg-[#ecebe8] dark:bg-[#2a2825] text-[#6b6661] dark:text-[#94908a] hover:bg-[#e15f80]/20 dark:hover:bg-[#e8788f]/20 hover:text-[#e15f80] dark:hover:text-[#e8788f] transition-all&quot;&gt;
          &lt;svg class=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V12h2.54V9.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V12h2.773l-.443 2.89h-2.33v6.988C18.343 21.128 22 16.991 22 12z&quot;/&gt;&lt;/svg&gt;
        &lt;/a&gt;
        &lt;a href=&quot;#&quot; class=&quot;w-10 h-10 flex items-center justify-center rounded-full bg-[#ecebe8] dark:bg-[#2a2825] text-[#6b6661] dark:text-[#94908a] hover:bg-[#e15f80]/20 dark:hover:bg-[#e8788f]/20 hover:text-[#e15f80] dark:hover:text-[#e8788f] transition-all&quot;&gt;
          &lt;svg class=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84&quot;/&gt;&lt;/svg&gt;
        &lt;/a&gt;
        &lt;a href=&quot;#&quot; class=&quot;w-10 h-10 flex items-center justify-center rounded-full bg-[#ecebe8] dark:bg-[#2a2825] text-[#6b6661] dark:text-[#94908a] hover:bg-[#e15f80]/20 dark:hover:bg-[#e8788f]/20 hover:text-[#e15f80] dark:hover:text-[#e8788f] transition-all&quot;&gt;
          &lt;svg class=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z&quot;/&gt;&lt;/svg&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;" data-height="auto" data-source-origins="HTML	profile-card/index.html" data-security-mode="trusted" data-allow-js="true" data-rune="sandbox" data-density="compact">
  <template data-content="fallback">
    <pre data-language="html"><code data-language="html">&lt;div data-source=&quot;HTML&quot;&gt;
&lt;div class=&quot;min-h-screen bg-[#f5f4f1] dark:bg-[#1a1a17] flex items-center justify-center p-6&quot;&gt;
  &lt;div class=&quot;bg-[#fbfaf7] dark:bg-[#211f1c] rounded-2xl shadow-xl max-w-sm w-full overflow-hidden transition-colors&quot;&gt;
    &lt;!-- Cover Image --&gt;
    &lt;div class=&quot;h-32 bg-gradient-to-r from-[#e15f80] to-[#c4501c] dark:from-[#e8788f] dark:to-[#e87a3a]&quot;&gt;&lt;/div&gt;

    &lt;!-- Profile Content --&gt;
    &lt;div class=&quot;relative px-6 pb-6&quot;&gt;
      &lt;!-- Avatar --&gt;
      &lt;div class=&quot;flex justify-center -mt-16 mb-4&quot;&gt;
        &lt;img
          src=&quot;https://i.pravatar.cc/120?img=32&quot;
          alt=&quot;Profile&quot;
          class=&quot;w-32 h-32 rounded-full border-4 border-[#fbfaf7] dark:border-[#211f1c] shadow-lg&quot;
        /&gt;
      &lt;/div&gt;

      &lt;!-- User Info --&gt;
      &lt;div class=&quot;text-center mb-6&quot;&gt;
        &lt;h2 class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef] mb-1&quot;&gt;Sarah Johnson&lt;/h2&gt;
        &lt;p class=&quot;text-[#6b6661] dark:text-[#94908a] text-sm mb-3&quot;&gt;@sarahjohnson&lt;/p&gt;
        &lt;p class=&quot;text-[#1c1a17]/80 dark:text-[#f6f4ef]/80 leading-relaxed&quot;&gt;
          Product designer passionate about crafting delightful user experiences.
          Coffee enthusiast ☕️
        &lt;/p&gt;
      &lt;/div&gt;

      &lt;!-- Stats --&gt;
      &lt;div class=&quot;flex justify-around py-4 border-y border-[#e2e0dd] dark:border-[#2a2825] mb-6&quot;&gt;
        &lt;div class=&quot;text-center&quot;&gt;
          &lt;div class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef]&quot;&gt;1.2k&lt;/div&gt;
          &lt;div class=&quot;text-xs text-[#6b6661] dark:text-[#94908a] uppercase tracking-wide&quot;&gt;Followers&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;text-center&quot;&gt;
          &lt;div class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef]&quot;&gt;842&lt;/div&gt;
          &lt;div class=&quot;text-xs text-[#6b6661] dark:text-[#94908a] uppercase tracking-wide&quot;&gt;Following&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;text-center&quot;&gt;
          &lt;div class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef]&quot;&gt;94&lt;/div&gt;
          &lt;div class=&quot;text-xs text-[#6b6661] dark:text-[#94908a] uppercase tracking-wide&quot;&gt;Posts&lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;!-- Action Buttons --&gt;
      &lt;div class=&quot;flex gap-3&quot;&gt;
        &lt;button class=&quot;flex-1 bg-gradient-to-r from-[#e15f80] to-[#c84a6c] dark:from-[#e8788f] dark:to-[#ef91a3] text-white font-semibold py-3 rounded-xl hover:from-[#c84a6c] hover:to-[#b35070] dark:hover:from-[#ef91a3] dark:hover:to-[#e89db0] transition-all shadow-lg shadow-[#e15f80]/30 dark:shadow-[#e8788f]/20&quot;&gt;
          Follow
        &lt;/button&gt;
        &lt;button class=&quot;flex-1 border-2 border-[#e2e0dd] dark:border-[#2a2825] text-[#1c1a17] dark:text-[#f6f4ef] font-semibold py-3 rounded-xl hover:bg-[#ecebe8] dark:hover:bg-[#2a2825] transition-all&quot;&gt;
          Message
        &lt;/button&gt;
      &lt;/div&gt;

      &lt;!-- Social Links --&gt;
      &lt;div class=&quot;flex justify-center gap-4 mt-6&quot;&gt;
        &lt;a href=&quot;#&quot; class=&quot;w-10 h-10 flex items-center justify-center rounded-full bg-[#ecebe8] dark:bg-[#2a2825] text-[#6b6661] dark:text-[#94908a] hover:bg-[#e15f80]/20 dark:hover:bg-[#e8788f]/20 hover:text-[#e15f80] dark:hover:text-[#e8788f] transition-all&quot;&gt;
          &lt;svg class=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V12h2.54V9.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V12h2.773l-.443 2.89h-2.33v6.988C18.343 21.128 22 16.991 22 12z&quot;/&gt;&lt;/svg&gt;
        &lt;/a&gt;
        &lt;a href=&quot;#&quot; class=&quot;w-10 h-10 flex items-center justify-center rounded-full bg-[#ecebe8] dark:bg-[#2a2825] text-[#6b6661] dark:text-[#94908a] hover:bg-[#e15f80]/20 dark:hover:bg-[#e8788f]/20 hover:text-[#e15f80] dark:hover:text-[#e8788f] transition-all&quot;&gt;
          &lt;svg class=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84&quot;/&gt;&lt;/svg&gt;
        &lt;/a&gt;
        &lt;a href=&quot;#&quot; class=&quot;w-10 h-10 flex items-center justify-center rounded-full bg-[#ecebe8] dark:bg-[#2a2825] text-[#6b6661] dark:text-[#94908a] hover:bg-[#e15f80]/20 dark:hover:bg-[#e8788f]/20 hover:text-[#e15f80] dark:hover:text-[#e8788f] transition-all&quot;&gt;
          &lt;svg class=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z&quot;/&gt;&lt;/svg&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;</code></pre>
  </template>
  <template data-content="source">&lt;div data-source=&quot;HTML&quot;&gt;
&lt;div class=&quot;min-h-screen bg-[#f5f4f1] dark:bg-[#1a1a17] flex items-center justify-center p-6&quot;&gt;
  &lt;div class=&quot;bg-[#fbfaf7] dark:bg-[#211f1c] rounded-2xl shadow-xl max-w-sm w-full overflow-hidden transition-colors&quot;&gt;
    &lt;!-- Cover Image --&gt;
    &lt;div class=&quot;h-32 bg-gradient-to-r from-[#e15f80] to-[#c4501c] dark:from-[#e8788f] dark:to-[#e87a3a]&quot;&gt;&lt;/div&gt;

    &lt;!-- Profile Content --&gt;
    &lt;div class=&quot;relative px-6 pb-6&quot;&gt;
      &lt;!-- Avatar --&gt;
      &lt;div class=&quot;flex justify-center -mt-16 mb-4&quot;&gt;
        &lt;img
          src=&quot;https://i.pravatar.cc/120?img=32&quot;
          alt=&quot;Profile&quot;
          class=&quot;w-32 h-32 rounded-full border-4 border-[#fbfaf7] dark:border-[#211f1c] shadow-lg&quot;
        /&gt;
      &lt;/div&gt;

      &lt;!-- User Info --&gt;
      &lt;div class=&quot;text-center mb-6&quot;&gt;
        &lt;h2 class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef] mb-1&quot;&gt;Sarah Johnson&lt;/h2&gt;
        &lt;p class=&quot;text-[#6b6661] dark:text-[#94908a] text-sm mb-3&quot;&gt;@sarahjohnson&lt;/p&gt;
        &lt;p class=&quot;text-[#1c1a17]/80 dark:text-[#f6f4ef]/80 leading-relaxed&quot;&gt;
          Product designer passionate about crafting delightful user experiences.
          Coffee enthusiast ☕️
        &lt;/p&gt;
      &lt;/div&gt;

      &lt;!-- Stats --&gt;
      &lt;div class=&quot;flex justify-around py-4 border-y border-[#e2e0dd] dark:border-[#2a2825] mb-6&quot;&gt;
        &lt;div class=&quot;text-center&quot;&gt;
          &lt;div class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef]&quot;&gt;1.2k&lt;/div&gt;
          &lt;div class=&quot;text-xs text-[#6b6661] dark:text-[#94908a] uppercase tracking-wide&quot;&gt;Followers&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;text-center&quot;&gt;
          &lt;div class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef]&quot;&gt;842&lt;/div&gt;
          &lt;div class=&quot;text-xs text-[#6b6661] dark:text-[#94908a] uppercase tracking-wide&quot;&gt;Following&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;text-center&quot;&gt;
          &lt;div class=&quot;text-2xl font-bold text-[#1c1a17] dark:text-[#f6f4ef]&quot;&gt;94&lt;/div&gt;
          &lt;div class=&quot;text-xs text-[#6b6661] dark:text-[#94908a] uppercase tracking-wide&quot;&gt;Posts&lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;!-- Action Buttons --&gt;
      &lt;div class=&quot;flex gap-3&quot;&gt;
        &lt;button class=&quot;flex-1 bg-gradient-to-r from-[#e15f80] to-[#c84a6c] dark:from-[#e8788f] dark:to-[#ef91a3] text-white font-semibold py-3 rounded-xl hover:from-[#c84a6c] hover:to-[#b35070] dark:hover:from-[#ef91a3] dark:hover:to-[#e89db0] transition-all shadow-lg shadow-[#e15f80]/30 dark:shadow-[#e8788f]/20&quot;&gt;
          Follow
        &lt;/button&gt;
        &lt;button class=&quot;flex-1 border-2 border-[#e2e0dd] dark:border-[#2a2825] text-[#1c1a17] dark:text-[#f6f4ef] font-semibold py-3 rounded-xl hover:bg-[#ecebe8] dark:hover:bg-[#2a2825] transition-all&quot;&gt;
          Message
        &lt;/button&gt;
      &lt;/div&gt;

      &lt;!-- Social Links --&gt;
      &lt;div class=&quot;flex justify-center gap-4 mt-6&quot;&gt;
        &lt;a href=&quot;#&quot; class=&quot;w-10 h-10 flex items-center justify-center rounded-full bg-[#ecebe8] dark:bg-[#2a2825] text-[#6b6661] dark:text-[#94908a] hover:bg-[#e15f80]/20 dark:hover:bg-[#e8788f]/20 hover:text-[#e15f80] dark:hover:text-[#e8788f] transition-all&quot;&gt;
          &lt;svg class=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V12h2.54V9.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V12h2.773l-.443 2.89h-2.33v6.988C18.343 21.128 22 16.991 22 12z&quot;/&gt;&lt;/svg&gt;
        &lt;/a&gt;
        &lt;a href=&quot;#&quot; class=&quot;w-10 h-10 flex items-center justify-center rounded-full bg-[#ecebe8] dark:bg-[#2a2825] text-[#6b6661] dark:text-[#94908a] hover:bg-[#e15f80]/20 dark:hover:bg-[#e8788f]/20 hover:text-[#e15f80] dark:hover:text-[#e8788f] transition-all&quot;&gt;
          &lt;svg class=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84&quot;/&gt;&lt;/svg&gt;
        &lt;/a&gt;
        &lt;a href=&quot;#&quot; class=&quot;w-10 h-10 flex items-center justify-center rounded-full bg-[#ecebe8] dark:bg-[#2a2825] text-[#6b6661] dark:text-[#94908a] hover:bg-[#e15f80]/20 dark:hover:bg-[#e8788f]/20 hover:text-[#e15f80] dark:hover:text-[#e8788f] transition-all&quot;&gt;
          &lt;svg class=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z&quot;/&gt;&lt;/svg&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;</template>
</rf-sandbox>

The source can also be read from a file: put a {% snippet %} where the fence would go, beside the content, and the code view shows the file as it is now. A snippet alone in a preview is the content instead, as on the snippet page.

If both a fence and source are present, the fence takes priority.

Sandbox embedding

Preview pairs naturally with the sandbox rune. Nest a sandbox inside a preview to get live HTML rendering with theme toggling, responsive viewports, and source code panels — all in one component.

{% sandbox framework="tailwind" %}
<button class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600">
  Save changes
</button>
{% /sandbox %}
<rf-sandbox data-rune="sandbox" data-source-content="&lt;button class=&quot;bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600&quot;&gt;
	  Save changes
	&lt;/button&gt;" data-framework="tailwind" data-height="auto" data-security-mode="trusted" data-allow-js="true">
  <template data-content="fallback">
    <pre data-language="html">
      <code data-language="html">&lt;button class=&quot;bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600&quot;&gt;
	  Save changes
	&lt;/button&gt;</code>
    </pre>
  </template>
  <template data-content="source">&lt;button class=&quot;bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600&quot;&gt;
	  Save changes
	&lt;/button&gt;</template>
</rf-sandbox>
<rf-sandbox class="rf-sandbox" data-source-content="&lt;button class=&quot;bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600&quot;&gt;
	  Save changes
	&lt;/button&gt;" data-framework="tailwind" data-height="auto" data-security-mode="trusted" data-allow-js="true" data-rune="sandbox" data-density="compact">
  <template data-content="fallback">
    <pre data-language="html"><code data-language="html">&lt;button class=&quot;bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600&quot;&gt;
	  Save changes
	&lt;/button&gt;</code></pre>
  </template>
  <template data-content="source">&lt;button class=&quot;bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600&quot;&gt;
	  Save changes
	&lt;/button&gt;</template>
</rf-sandbox>

The preview toolbar controls the sandbox iframe — theme toggles propagate into the iframe, and viewport presets constrain its width. Add data-source attributes inside the sandbox to extract specific elements as syntax-highlighted source panels:

{% sandbox framework="tailwind" %}
<style data-source="CSS">
  .card { padding: 1.5rem; border-radius: 0.5rem; border: 1px solid #e5e7eb; }
</style>
<div class="card" data-source="HTML">
  <h3 class="font-semibold">Free returns</h3>
  <p>Send it back within 30 days for a full refund.</p>
</div>
{% /sandbox %}
<rf-sandbox data-rune="sandbox" data-source-content="&lt;style data-source=&quot;CSS&quot;&gt;
	  .card { padding: 1.5rem; border-radius: 0.5rem; border: 1px solid #e5e7eb; }
	&lt;/style&gt;
	&lt;div class=&quot;card&quot; data-source=&quot;HTML&quot;&gt;
	  &lt;h3 class=&quot;font-semibold&quot;&gt;Free returns&lt;/h3&gt;
	  &lt;p&gt;Send it back within 30 days for a full refund.&lt;/p&gt;
	&lt;/div&gt;" data-framework="tailwind" data-height="auto" data-security-mode="trusted" data-allow-js="true">
  <template data-content="fallback">
    <pre data-language="html">
      <code data-language="html">&lt;style data-source=&quot;CSS&quot;&gt;
	  .card { padding: 1.5rem; border-radius: 0.5rem; border: 1px solid #e5e7eb; }
	&lt;/style&gt;
	&lt;div class=&quot;card&quot; data-source=&quot;HTML&quot;&gt;
	  &lt;h3 class=&quot;font-semibold&quot;&gt;Free returns&lt;/h3&gt;
	  &lt;p&gt;Send it back within 30 days for a full refund.&lt;/p&gt;
	&lt;/div&gt;</code>
    </pre>
  </template>
  <template data-content="source">&lt;style data-source=&quot;CSS&quot;&gt;
	  .card { padding: 1.5rem; border-radius: 0.5rem; border: 1px solid #e5e7eb; }
	&lt;/style&gt;
	&lt;div class=&quot;card&quot; data-source=&quot;HTML&quot;&gt;
	  &lt;h3 class=&quot;font-semibold&quot;&gt;Free returns&lt;/h3&gt;
	  &lt;p&gt;Send it back within 30 days for a full refund.&lt;/p&gt;
	&lt;/div&gt;</template>
</rf-sandbox>
<rf-sandbox class="rf-sandbox" data-source-content="&lt;style data-source=&quot;CSS&quot;&gt;
	  .card { padding: 1.5rem; border-radius: 0.5rem; border: 1px solid #e5e7eb; }
	&lt;/style&gt;
	&lt;div class=&quot;card&quot; data-source=&quot;HTML&quot;&gt;
	  &lt;h3 class=&quot;font-semibold&quot;&gt;Free returns&lt;/h3&gt;
	  &lt;p&gt;Send it back within 30 days for a full refund.&lt;/p&gt;
	&lt;/div&gt;" data-framework="tailwind" data-height="auto" data-security-mode="trusted" data-allow-js="true" data-rune="sandbox" data-density="compact">
  <template data-content="fallback">
    <pre data-language="html"><code data-language="html">&lt;style data-source=&quot;CSS&quot;&gt;
	  .card { padding: 1.5rem; border-radius: 0.5rem; border: 1px solid #e5e7eb; }
	&lt;/style&gt;
	&lt;div class=&quot;card&quot; data-source=&quot;HTML&quot;&gt;
	  &lt;h3 class=&quot;font-semibold&quot;&gt;Free returns&lt;/h3&gt;
	  &lt;p&gt;Send it back within 30 days for a full refund.&lt;/p&gt;
	&lt;/div&gt;</code></pre>
  </template>
  <template data-content="source">&lt;style data-source=&quot;CSS&quot;&gt;
	  .card { padding: 1.5rem; border-radius: 0.5rem; border: 1px solid #e5e7eb; }
	&lt;/style&gt;
	&lt;div class=&quot;card&quot; data-source=&quot;HTML&quot;&gt;
	  &lt;h3 class=&quot;font-semibold&quot;&gt;Free returns&lt;/h3&gt;
	  &lt;p&gt;Send it back within 30 days for a full refund.&lt;/p&gt;
	&lt;/div&gt;</template>
</rf-sandbox>

See the sandbox rune docs for full details on framework presets, dependencies, and data-source panels.

Attributes

AttributeTypeRequiredDescription
titlestring—Label shown in the preview card header.
theme"auto" | "light" | "dark"—Background theme for the preview viewport: auto follows the page, light/dark forces a mode.
sourceboolean—Enable/disable showing the source code panel alongside the rendered preview.
responsivestring—Comma-separated viewport presets (e.g. "mobile,tablet,desktop") for responsive preview frames. Accepts mobile (375px), tablet (768px), and desktop (full); other values are ignored.

Universal attributes

bg

The background layer: image, video, gradient, flat overlay wash and legibility scrim, in a single injected layer behind the rune's content.

AttributeTypeRequiredDescription
bgstring—Background preset applied to this block
bg-fromstring—Gradient start colour — a semantic token name (→ var(--rf-color-*))
bg-gradient"to-t" | "to-b" | "to-l" | "to-r" | "to-tr" | "to-br" | "to-bl" | "to-tl"—Gradient direction (bounded named set)
bg-gradient-type"linear" | "radial" | "conic"—Gradient type
bg-tostring—Gradient end colour — a semantic token name
bg-viastring—Optional middle gradient stop — a semantic token name
scrim"top" | "bottom" | "left" | "right" | "none"—Scrim direction (heaviest edge); presence turns the scrim on, "none" opts out of the default cover scrim
scrim-blur"none" | "sm" | "md" | "lg"—Frost scrim blur amount
scrim-strength"sm" | "md" | "lg"—Gradient scrim strength
scrim-tone"dark" | "light"—Whether the scrim darkens (for light text) or lightens (for dark text)
scrim-type"gradient" | "frost"—Scrim treatment: gradient (default) or frost (backdrop blur)
elevation

How far the rune sits off the page, from sunken to overlay. The theme decides what each step looks like.

AttributeTypeRequiredDescription
elevation"sunken" | "flush" | "flat" | "raised" | "floating" | "overlay" | "none" | "sm" | "md" | "lg"—Surface depth, from sunken to overlay. Deprecated: none, sm, md and lg (read as flat, raised, raised and floating)
inset

Internal padding override.

AttributeTypeRequiredDescription
inset"flush" | "tight" | "default" | "loose" | "breathe"—Inner padding of this block
motion

Scroll-reveal entrance. You choose its character; the theme decides how it moves.

AttributeTypeRequiredDescription
reveal"none" | "fade" | "slide" | "scale" | "blur"—Scroll-reveal entrance character (none|fade|slide|scale|blur); the theme owns the choreography
staggerboolean—Cascade this block's items in as it reveals (no-op on single-child runes)
spacing

Block-level rhythm override.

AttributeTypeRequiredDescription
spacing"flush" | "tight" | "default" | "loose" | "breathe"—Vertical spacing above and below this block
substrate

Generated pattern fills behind the content, drawn by the theme.

AttributeTypeRequiredDescription
substrate"dots" | "grid" | "lines" | "cross" | "checker" | "none"—Generated surface pattern
substrate-fill"inherit" | "inset"—Surface fill the pattern sits on (full colour stays with tint)
substrate-opacity"sm" | "md" | "lg"—Pattern ink strength
substrate-size"sm" | "md" | "lg"—Pattern cell size
substrate-target"self" | "media"—Which surface the pattern fills (overrides the rune/theme default)
tint

Per-rune colour override: a named tint from the theme registry, with inline per-token overrides layered on top.

AttributeTypeRequiredDescription
tintstring—Color tint preset applied to this block
tint-mode"auto" | "dark" | "light"—Whether the tint adapts to auto, dark, or light mode
width

The track a block rune occupies.

AttributeTypeRequiredDescription
width"compact" | "narrow" | "content" | "wide" | "full"—Maximum width constraint for this block
Not availableWhy
dropcap, readingthis rune declares no prose body
framethis rune declares neither a `frameTarget` nor a media section
prominencethis rune has no page-section header or featured quotation