Arrangement›Showcase

core

Showcase

Present visual content with frame chrome — shadow, displacement (bleed), offset, and aspect ratio

Source

import Markdoc from '@markdoc/markdoc';
const { Tag } = Markdoc;
import {
	createContentModelSchema,
	bodyOnly,
	createComponentRenderable,
	renderNodes,
} from '../lib/index.js';

const shadowValues = ['none', 'soft', 'hard', 'elevated'] as const;
const bleedValues = ['none', 'top', 'bottom', 'both', 'end', 'bottom-end', 'top-end'] as const;

const SHADOW_TO_FRAME: Record<string, string> = { soft: 'sm', hard: 'md', elevated: 'lg' };
const SHOWCASE_DEPRECATED_WARNED = new Set<string>();
function warnShowcaseDeprecated(attr: string, replacement: string): void {
	if (SHOWCASE_DEPRECATED_WARNED.has(attr)) return;
	SHOWCASE_DEPRECATED_WARNED.add(attr);
	// eslint-disable-next-line no-console
	console.warn(
		`[refrakt] showcase \`${attr}\` is deprecated — use \`${replacement}\`. The alias will be removed in a future minor.`,
	);
}

export const showcaseSections = { viewport: 'body' } as const;
export const showcaseFrameTarget = 'self' as const;

export const showcase = createContentModelSchema({
	sections: showcaseSections,
	frameTarget: showcaseFrameTarget,
	attributes: {
		shadow: {
			type: String,
			required: false,
			matches: shadowValues.slice(),
			description:
				'Deprecated: use `frame-shadow` (`soft`, `hard`, `elevated` become `sm`, `md`, `lg`)',
		},
		bleed: {
			type: String,
			required: false,
			matches: bleedValues.slice(),
			description: 'Deprecated: use `frame-displace`',
		},
		offset: { type: String, required: false, description: 'Deprecated: use `frame-offset`' },
		aspect: { type: String, required: false, description: 'Deprecated: use `frame-aspect`' },
		place: {
			type: String,
			required: false,
			matches: [
				'left',
				'center',
				'right',
				'top',
				'bottom',
				'top left',
				'top center',
				'top right',
				'bottom left',
				'bottom center',
				'bottom right',
			],
			description: 'Deprecated: use `frame-place`',
		},
	},
	contentModel: bodyOnly(),
	transform(resolved, attrs, config) {
		const children = renderNodes(resolved.body, config);

		const shadow = attrs.shadow ?? 'none';
		const bleed = attrs.bleed ?? 'none';
		const offset = attrs.offset ?? '';
		const aspect = attrs.aspect ?? '';
		const place = attrs.place ?? '';

		const properties: Record<string, any> = {};
		const frameMeta = (field: string, value: string) => {
			const meta = new Tag('meta', { content: value });
			properties[field] = meta;
		};

		if (shadow && shadow !== 'none') {
			warnShowcaseDeprecated('shadow', 'frame-shadow');
			frameMeta('frame-shadow', SHADOW_TO_FRAME[shadow] ?? shadow);
		}
		if (bleed && bleed !== 'none') {
			warnShowcaseDeprecated('bleed', 'frame-displace');
			frameMeta('frame-displace', bleed);
		}
		if (offset) {
			warnShowcaseDeprecated('offset', 'frame-offset');
			frameMeta('frame-offset', offset);
		}
		if (aspect) {
			warnShowcaseDeprecated('aspect', 'frame-aspect');
			frameMeta('frame-aspect', aspect);
		}
		if (place) {
			warnShowcaseDeprecated('place', 'frame-place');
			frameMeta('frame-place', place);
		}

		const viewport = new Tag('div', {}, children.toArray());

		return createComponentRenderable({
			rune: 'showcase',
			tag: 'div',
			properties,
			refs: {
				viewport,
			},
			children: [viewport],
		});
	},
});

View packages/runes/src/tags/showcase.ts on GitHub

Present visual content in a constrained viewport with optional decorative chrome. The showcase rune wraps images, videos, or embedded content — useful for screenshots, product shots, or component previews. To caption an image, use figure; to set an image beside a passage of text, use mediatext.

Showcase is the degenerate frameTarget: "self" case of the surface model: its body is the media, so frame chrome (shadow, displacement, offset, aspect) lands on the showcase itself. Its distinct value is breakout — spilling past a non-clipping ancestor.

Basic usage

Wrap any visual content in a showcase to give it a framed presentation.

{% showcase %}
	{% sandbox src="acme-dashboard" framework="tailwind" height=460 /%}
{% /showcase %}
<div data-rune="showcase">
  <div data-name="viewport">
    <rf-sandbox data-rune="sandbox" data-source-content="&lt;div data-source=&quot;HTML&quot;&gt;
&lt;div class=&quot;min-h-screen bg-slate-50 dark:bg-slate-900 text-slate-900 dark:text-slate-100 font-sans transition-colors&quot;&gt;
  &lt;div class=&quot;flex items-center justify-between px-5 py-3 bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700&quot;&gt;
    &lt;div class=&quot;font-bold text-sm&quot;&gt;Acme&lt;/div&gt;
    &lt;div class=&quot;w-7 h-7 rounded-full bg-gradient-to-br from-indigo-300 to-indigo-600&quot;&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;main class=&quot;p-5&quot;&gt;
    &lt;h1 class=&quot;text-xl font-bold mb-4&quot;&gt;Dashboard&lt;/h1&gt;
    &lt;div class=&quot;grid grid-cols-3 gap-3.5&quot;&gt;
      &lt;div class=&quot;bg-white dark:bg-slate-800 rounded-xl p-4 shadow-sm&quot;&gt;
        &lt;div class=&quot;text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500&quot;&gt;Revenue&lt;/div&gt;
        &lt;div class=&quot;text-2xl font-bold mt-1.5&quot;&gt;$48.2k&lt;/div&gt;
        &lt;div class=&quot;text-xs text-emerald-500 dark:text-emerald-400 mt-0.5&quot;&gt;+14%&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;bg-white dark:bg-slate-800 rounded-xl p-4 shadow-sm&quot;&gt;
        &lt;div class=&quot;text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500&quot;&gt;Users&lt;/div&gt;
        &lt;div class=&quot;text-2xl font-bold mt-1.5&quot;&gt;2,841&lt;/div&gt;
        &lt;div class=&quot;text-xs text-emerald-500 dark:text-emerald-400 mt-0.5&quot;&gt;+7%&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;bg-white dark:bg-slate-800 rounded-xl p-4 shadow-sm&quot;&gt;
        &lt;div class=&quot;text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500&quot;&gt;Churn&lt;/div&gt;
        &lt;div class=&quot;text-2xl font-bold mt-1.5&quot;&gt;2.1%&lt;/div&gt;
        &lt;div class=&quot;text-xs text-rose-500 dark:text-rose-400 mt-0.5&quot;&gt;+0.3%&lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/main&gt;
&lt;/div&gt;

&lt;/div&gt;" data-framework="tailwind" data-height="460" data-source-origins="HTML	acme-dashboard/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-slate-50 dark:bg-slate-900 text-slate-900 dark:text-slate-100 font-sans transition-colors&quot;&gt;
  &lt;div class=&quot;flex items-center justify-between px-5 py-3 bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700&quot;&gt;
    &lt;div class=&quot;font-bold text-sm&quot;&gt;Acme&lt;/div&gt;
    &lt;div class=&quot;w-7 h-7 rounded-full bg-gradient-to-br from-indigo-300 to-indigo-600&quot;&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;main class=&quot;p-5&quot;&gt;
    &lt;h1 class=&quot;text-xl font-bold mb-4&quot;&gt;Dashboard&lt;/h1&gt;
    &lt;div class=&quot;grid grid-cols-3 gap-3.5&quot;&gt;
      &lt;div class=&quot;bg-white dark:bg-slate-800 rounded-xl p-4 shadow-sm&quot;&gt;
        &lt;div class=&quot;text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500&quot;&gt;Revenue&lt;/div&gt;
        &lt;div class=&quot;text-2xl font-bold mt-1.5&quot;&gt;$48.2k&lt;/div&gt;
        &lt;div class=&quot;text-xs text-emerald-500 dark:text-emerald-400 mt-0.5&quot;&gt;+14%&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;bg-white dark:bg-slate-800 rounded-xl p-4 shadow-sm&quot;&gt;
        &lt;div class=&quot;text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500&quot;&gt;Users&lt;/div&gt;
        &lt;div class=&quot;text-2xl font-bold mt-1.5&quot;&gt;2,841&lt;/div&gt;
        &lt;div class=&quot;text-xs text-emerald-500 dark:text-emerald-400 mt-0.5&quot;&gt;+7%&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;bg-white dark:bg-slate-800 rounded-xl p-4 shadow-sm&quot;&gt;
        &lt;div class=&quot;text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500&quot;&gt;Churn&lt;/div&gt;
        &lt;div class=&quot;text-2xl font-bold mt-1.5&quot;&gt;2.1%&lt;/div&gt;
        &lt;div class=&quot;text-xs text-rose-500 dark:text-rose-400 mt-0.5&quot;&gt;+0.3%&lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/main&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-slate-50 dark:bg-slate-900 text-slate-900 dark:text-slate-100 font-sans transition-colors&quot;&gt;
  &lt;div class=&quot;flex items-center justify-between px-5 py-3 bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700&quot;&gt;
    &lt;div class=&quot;font-bold text-sm&quot;&gt;Acme&lt;/div&gt;
    &lt;div class=&quot;w-7 h-7 rounded-full bg-gradient-to-br from-indigo-300 to-indigo-600&quot;&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;main class=&quot;p-5&quot;&gt;
    &lt;h1 class=&quot;text-xl font-bold mb-4&quot;&gt;Dashboard&lt;/h1&gt;
    &lt;div class=&quot;grid grid-cols-3 gap-3.5&quot;&gt;
      &lt;div class=&quot;bg-white dark:bg-slate-800 rounded-xl p-4 shadow-sm&quot;&gt;
        &lt;div class=&quot;text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500&quot;&gt;Revenue&lt;/div&gt;
        &lt;div class=&quot;text-2xl font-bold mt-1.5&quot;&gt;$48.2k&lt;/div&gt;
        &lt;div class=&quot;text-xs text-emerald-500 dark:text-emerald-400 mt-0.5&quot;&gt;+14%&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;bg-white dark:bg-slate-800 rounded-xl p-4 shadow-sm&quot;&gt;
        &lt;div class=&quot;text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500&quot;&gt;Users&lt;/div&gt;
        &lt;div class=&quot;text-2xl font-bold mt-1.5&quot;&gt;2,841&lt;/div&gt;
        &lt;div class=&quot;text-xs text-emerald-500 dark:text-emerald-400 mt-0.5&quot;&gt;+7%&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;bg-white dark:bg-slate-800 rounded-xl p-4 shadow-sm&quot;&gt;
        &lt;div class=&quot;text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500&quot;&gt;Churn&lt;/div&gt;
        &lt;div class=&quot;text-2xl font-bold mt-1.5&quot;&gt;2.1%&lt;/div&gt;
        &lt;div class=&quot;text-xs text-rose-500 dark:text-rose-400 mt-0.5&quot;&gt;+0.3%&lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/main&gt;
&lt;/div&gt;

&lt;/div&gt;</template>
    </rf-sandbox>
  </div>
</div>
<div class="rf-showcase" data-rune="showcase" data-density="compact">
  <div data-name="viewport" class="rf-showcase__viewport" data-section="body">
    <rf-sandbox class="rf-sandbox" data-source-content="&lt;div data-source=&quot;HTML&quot;&gt;
&lt;div class=&quot;min-h-screen bg-slate-50 dark:bg-slate-900 text-slate-900 dark:text-slate-100 font-sans transition-colors&quot;&gt;
  &lt;div class=&quot;flex items-center justify-between px-5 py-3 bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700&quot;&gt;
    &lt;div class=&quot;font-bold text-sm&quot;&gt;Acme&lt;/div&gt;
    &lt;div class=&quot;w-7 h-7 rounded-full bg-gradient-to-br from-indigo-300 to-indigo-600&quot;&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;main class=&quot;p-5&quot;&gt;
    &lt;h1 class=&quot;text-xl font-bold mb-4&quot;&gt;Dashboard&lt;/h1&gt;
    &lt;div class=&quot;grid grid-cols-3 gap-3.5&quot;&gt;
      &lt;div class=&quot;bg-white dark:bg-slate-800 rounded-xl p-4 shadow-sm&quot;&gt;
        &lt;div class=&quot;text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500&quot;&gt;Revenue&lt;/div&gt;
        &lt;div class=&quot;text-2xl font-bold mt-1.5&quot;&gt;$48.2k&lt;/div&gt;
        &lt;div class=&quot;text-xs text-emerald-500 dark:text-emerald-400 mt-0.5&quot;&gt;+14%&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;bg-white dark:bg-slate-800 rounded-xl p-4 shadow-sm&quot;&gt;
        &lt;div class=&quot;text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500&quot;&gt;Users&lt;/div&gt;
        &lt;div class=&quot;text-2xl font-bold mt-1.5&quot;&gt;2,841&lt;/div&gt;
        &lt;div class=&quot;text-xs text-emerald-500 dark:text-emerald-400 mt-0.5&quot;&gt;+7%&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;bg-white dark:bg-slate-800 rounded-xl p-4 shadow-sm&quot;&gt;
        &lt;div class=&quot;text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500&quot;&gt;Churn&lt;/div&gt;
        &lt;div class=&quot;text-2xl font-bold mt-1.5&quot;&gt;2.1%&lt;/div&gt;
        &lt;div class=&quot;text-xs text-rose-500 dark:text-rose-400 mt-0.5&quot;&gt;+0.3%&lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/main&gt;
&lt;/div&gt;

&lt;/div&gt;" data-framework="tailwind" data-height="460" data-source-origins="HTML	acme-dashboard/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-slate-50 dark:bg-slate-900 text-slate-900 dark:text-slate-100 font-sans transition-colors&quot;&gt;
  &lt;div class=&quot;flex items-center justify-between px-5 py-3 bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700&quot;&gt;
    &lt;div class=&quot;font-bold text-sm&quot;&gt;Acme&lt;/div&gt;
    &lt;div class=&quot;w-7 h-7 rounded-full bg-gradient-to-br from-indigo-300 to-indigo-600&quot;&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;main class=&quot;p-5&quot;&gt;
    &lt;h1 class=&quot;text-xl font-bold mb-4&quot;&gt;Dashboard&lt;/h1&gt;
    &lt;div class=&quot;grid grid-cols-3 gap-3.5&quot;&gt;
      &lt;div class=&quot;bg-white dark:bg-slate-800 rounded-xl p-4 shadow-sm&quot;&gt;
        &lt;div class=&quot;text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500&quot;&gt;Revenue&lt;/div&gt;
        &lt;div class=&quot;text-2xl font-bold mt-1.5&quot;&gt;$48.2k&lt;/div&gt;
        &lt;div class=&quot;text-xs text-emerald-500 dark:text-emerald-400 mt-0.5&quot;&gt;+14%&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;bg-white dark:bg-slate-800 rounded-xl p-4 shadow-sm&quot;&gt;
        &lt;div class=&quot;text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500&quot;&gt;Users&lt;/div&gt;
        &lt;div class=&quot;text-2xl font-bold mt-1.5&quot;&gt;2,841&lt;/div&gt;
        &lt;div class=&quot;text-xs text-emerald-500 dark:text-emerald-400 mt-0.5&quot;&gt;+7%&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;bg-white dark:bg-slate-800 rounded-xl p-4 shadow-sm&quot;&gt;
        &lt;div class=&quot;text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500&quot;&gt;Churn&lt;/div&gt;
        &lt;div class=&quot;text-2xl font-bold mt-1.5&quot;&gt;2.1%&lt;/div&gt;
        &lt;div class=&quot;text-xs text-rose-500 dark:text-rose-400 mt-0.5&quot;&gt;+0.3%&lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/main&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-slate-50 dark:bg-slate-900 text-slate-900 dark:text-slate-100 font-sans transition-colors&quot;&gt;
  &lt;div class=&quot;flex items-center justify-between px-5 py-3 bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700&quot;&gt;
    &lt;div class=&quot;font-bold text-sm&quot;&gt;Acme&lt;/div&gt;
    &lt;div class=&quot;w-7 h-7 rounded-full bg-gradient-to-br from-indigo-300 to-indigo-600&quot;&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;main class=&quot;p-5&quot;&gt;
    &lt;h1 class=&quot;text-xl font-bold mb-4&quot;&gt;Dashboard&lt;/h1&gt;
    &lt;div class=&quot;grid grid-cols-3 gap-3.5&quot;&gt;
      &lt;div class=&quot;bg-white dark:bg-slate-800 rounded-xl p-4 shadow-sm&quot;&gt;
        &lt;div class=&quot;text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500&quot;&gt;Revenue&lt;/div&gt;
        &lt;div class=&quot;text-2xl font-bold mt-1.5&quot;&gt;$48.2k&lt;/div&gt;
        &lt;div class=&quot;text-xs text-emerald-500 dark:text-emerald-400 mt-0.5&quot;&gt;+14%&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;bg-white dark:bg-slate-800 rounded-xl p-4 shadow-sm&quot;&gt;
        &lt;div class=&quot;text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500&quot;&gt;Users&lt;/div&gt;
        &lt;div class=&quot;text-2xl font-bold mt-1.5&quot;&gt;2,841&lt;/div&gt;
        &lt;div class=&quot;text-xs text-emerald-500 dark:text-emerald-400 mt-0.5&quot;&gt;+7%&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;bg-white dark:bg-slate-800 rounded-xl p-4 shadow-sm&quot;&gt;
        &lt;div class=&quot;text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500&quot;&gt;Churn&lt;/div&gt;
        &lt;div class=&quot;text-2xl font-bold mt-1.5&quot;&gt;2.1%&lt;/div&gt;
        &lt;div class=&quot;text-xs text-rose-500 dark:text-rose-400 mt-0.5&quot;&gt;+0.3%&lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/main&gt;
&lt;/div&gt;

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

Shadow

Add a silhouette drop-shadow with frame-shadow. Four levels: none, sm, md, lg. (This is distinct from elevation, which is a box-shadow on a rune's self surface — see surfaces.)

{% showcase frame-shadow="lg" %}
![A tequila sunrise in a tall glass](https://assets.refrakt.md/tequila-sunrise.png)
{% /showcase %}
<div data-rune="showcase">
  <div data-name="viewport">
    <p>
      <img src="https://assets.refrakt.md/tequila-sunrise.png" alt="A tequila sunrise in a tall glass">
    </p>
  </div>
  <meta data-field="frame-shadow" content="lg">
</div>

A tequila sunrise in a tall glass

<div class="rf-showcase" data-frame-shadow="lg" data-rune="showcase" data-density="compact">
  <div data-name="viewport" class="rf-showcase__viewport" data-section="body">
    <p>
      <img src="https://assets.refrakt.md/tequila-sunrise.png" alt="A tequila sunrise in a tall glass" />
    </p>
  </div>
</div>

Bleed (displacement)

Let the showcase spill beyond its container — a breakout host renders overflow: visible. frame-displace picks the edge or corner the content moves toward; frame-offset is the distance.

{% showcase frame-shadow="sm" frame-displace="bottom" frame-offset="lg" %}
![Raked gravel and stones in a zen garden](https://assets.refrakt.md/media-text-zen-garden.jpg)
{% /showcase %}
<div data-rune="showcase">
  <div data-name="viewport">
    <p>
      <img src="https://assets.refrakt.md/media-text-zen-garden.jpg" alt="Raked gravel and stones in a zen garden">
    </p>
  </div>
  <meta data-field="frame-displace" content="bottom">
  <meta data-field="frame-offset" content="lg">
  <meta data-field="frame-shadow" content="sm">
</div>

Raked gravel and stones in a zen garden

<div class="rf-showcase" data-displace="bottom" data-frame-shadow="sm" data-rune="showcase" data-density="compact" style="--frame-offset: var(--rf-spacing-lg)">
  <div data-name="viewport" class="rf-showcase__viewport" data-section="body">
    <p>
      <img src="https://assets.refrakt.md/media-text-zen-garden.jpg" alt="Raked gravel and stones in a zen garden" />
    </p>
  </div>
</div>

Displace directions: top, bottom, end, bottom-end, top-end (both is also accepted). frame-offset is a named scale — none, sm, md, lg, xl (backed by the spacing tokens); a raw length warns and collapses to none.

Clip is host-owned: inside a clipping host (e.g. a bento cell) the same displaced showcase is cropped into a peek instead of spilling. frame-offset collapses on mobile regardless of host.

Aspect ratio

Enforce a uniform aspect ratio with frame-aspect. Content is cropped to fit (object-fit: cover).

{% showcase frame-aspect="16/9" frame-shadow="sm" %}
![A river winding through a green valley](https://assets.refrakt.md/media-text-valley.jpg)
{% /showcase %}
<div data-rune="showcase">
  <div data-name="viewport">
    <p>
      <img src="https://assets.refrakt.md/media-text-valley.jpg" alt="A river winding through a green valley">
    </p>
  </div>
  <meta data-field="frame-aspect" content="16/9">
  <meta data-field="frame-shadow" content="sm">
</div>

A river winding through a green valley

<div class="rf-showcase" data-frame-shadow="sm" data-rune="showcase" data-density="compact" style="--frame-aspect: 16/9">
  <div data-name="viewport" class="rf-showcase__viewport" data-section="body">
    <p>
      <img src="https://assets.refrakt.md/media-text-valley.jpg" alt="A river winding through a green valley" />
    </p>
  </div>
</div>

Combined

Facets compose freely.

{% showcase frame-shadow="lg" frame-displace="both" frame-aspect="16/9" %}
![Fish over a shallow coral reef](https://assets.refrakt.md/figure-coral-reef.jpg)
{% /showcase %}
<div data-rune="showcase">
  <div data-name="viewport">
    <p>
      <img src="https://assets.refrakt.md/figure-coral-reef.jpg" alt="Fish over a shallow coral reef">
    </p>
  </div>
  <meta data-field="frame-aspect" content="16/9">
  <meta data-field="frame-displace" content="both">
  <meta data-field="frame-shadow" content="lg">
</div>

Fish over a shallow coral reef

<div class="rf-showcase" data-displace="both" data-frame-shadow="lg" data-rune="showcase" data-density="compact" style="--frame-aspect: 16/9">
  <div data-name="viewport" class="rf-showcase__viewport" data-section="body">
    <p>
      <img src="https://assets.refrakt.md/figure-coral-reef.jpg" alt="Fish over a shallow coral reef" />
    </p>
  </div>
</div>

Attributes

AttributeTypeRequiredDescription
shadow"none" | "soft" | "hard" | "elevated"—Deprecated: use `frame-shadow` (`soft`, `hard`, `elevated` become `sm`, `md`, `lg`)
bleed"none" | "top" | "bottom" | "both" | "end" | "bottom-end" | "top-end"—Deprecated: use `frame-displace`
offsetstring—Deprecated: use `frame-offset`
aspectstring—Deprecated: use `frame-aspect`
place"left" | "center" | "right" | "top" | "bottom" | "top left" | "top center" | "top right" | "bottom left" | "bottom center" | "bottom right"—Deprecated: use `frame-place`

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)
frame

Surface chrome: a named preset from the theme registry with inline `frame-*` overrides layered on top.

AttributeTypeRequiredDescription
framestring—Named frame preset presenting this block's media surface
frame-anchorstring—Crop focal point when the guest is cut (object-position)
frame-aspectstring—Aspect ratio of the framed media, e.g. "16/9"
frame-displace"top" | "bottom" | "end" | "bottom-end" | "top-end" | "both"—Edge/corner the framed guest moves toward
frame-displace-mode"peek" | "bleed"—How displacement renders: `peek` (default) translates the guest visually inside its frame target; `bleed` uses negative margin on the media zone so following layout pulls up — extends past a section like a hero without leaving a gap above
frame-offset"none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl"—Displacement distance (non-linear named scale: sm…xl ride the block-spacing tokens, 2xl/3xl/4xl step up to section-spacing for bleed-mode displacements that clear a section edge)
frame-overflow"clip" | "bleed"—How the frame handles a guest whose content is wider than it: `clip` (default) keeps it inside the rounded frame; `bleed` runs an overflowing guest out to the layout edge on a narrow viewport so it reads as cropped by the screen (a bleed host only — hero/feature)
frame-oversizestring—How far the guest exceeds its slot (scale factor)
frame-placestring—Guest-box alignment in the slot (e.g. "left top")
frame-shadow"none" | "sm" | "md" | "lg"—Silhouette drop-shadow strength for the framed media
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
prominencethis rune has no page-section header or featured quotation