Marketing›Comparison

marketing

Comparison

Product and feature comparison matrices from Markdown

Install

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

About the plugin and its runes

Source

import Markdoc from '@markdoc/markdoc';
import type { Node, RenderableTreeNode } from '@markdoc/markdoc';
const { Ast, Tag } = Markdoc;
import {
	createComponentRenderable,
	createContentModelSchema,
	bodyOnly,
	asNodes,
	renderNodes,
	headingsToList,
	extractText,
	fieldMetas,
} from '@refrakt-md/runes';

function extractBoldLabel(node: Node): string | null {
	for (const child of node.walk()) {
		if (child.type === 'strong') {
			return Array.from(child.walk())
				.filter((n) => n.type === 'text')
				.map((n) => n.attributes.content)
				.join('');
		}
	}
	return null;
}

function detectRowType(node: Node): string {
	const text = extractText(node);
	if (/^\s*\[x\]/i.test(text)) return 'check';
	if (/^\s*\[\s*\]/.test(text)) return 'cross';

	for (const child of node.walk()) {
		if (child.type === 's') return 'negative';
	}

	return 'text';
}

function getDescriptionChildren(node: Node): Node[] {
	if (!node.children.length) return node.children;

	const firstChild = node.children[0];
	if (firstChild.type !== 'paragraph' && firstChild.type !== 'inline') return node.children;

	const strongIndex = firstChild.children.findIndex((c) => c.type === 'strong');
	if (strongIndex === -1) return node.children;

	const afterStrong = firstChild.children.slice(strongIndex + 1);

	if (afterStrong.length > 0 && afterStrong[0].type === 'text') {
		const text = afterStrong[0].attributes.content;
		const stripped = text.replace(/^\s*[-–—:]\s*/, '');
		if (stripped) {
			afterStrong[0] = new Ast.Node('text', { content: stripped }, []);
		} else {
			afterStrong.shift();
		}
	}

	if (afterStrong.length === 0) {
		return node.children.slice(1);
	}

	const newParagraph = new Ast.Node('paragraph', firstChild.attributes, afterStrong);
	return [newParagraph, ...node.children.slice(1)];
}

interface ParsedRow {
	label: string | null;
	rowType: string;
	children: Node[];
}

interface ParsedColumn {
	name: string;
	highlighted: boolean;
	labeledRows: Map<string, ParsedRow>;
	secondaryRows: ParsedRow[];
	callouts: ParsedRow[];
}

const comparisonRow = createContentModelSchema({
	attributes: {
		label: { type: String, required: false },
		rowType: { type: String, required: false },
	},
	contentModel: bodyOnly(),
	transform(resolved, attrs, config) {
		const labelTag = new Tag('span', {}, [attrs.label ?? '']);
		const body = renderNodes(resolved.body, config).wrap('div');

		return createComponentRenderable({
			rune: 'comparison-row',
			tag: 'div',
			properties: fieldMetas(attrs, config, {
				rowType: 'text',
			}),
			refs: {
				body: body.tag('div'),
				label: labelTag,
			},
			children: [labelTag, body.next()],
		});
	},
});

const comparisonColumn = createContentModelSchema({
	attributes: {
		name: { type: String, required: false },
		highlighted: { type: Boolean, required: false },
	},
	contentModel: bodyOnly(),
	transform(resolved, attrs, config) {
		const nameTag = new Tag('span', {}, [attrs.name ?? '']);
		const highlightedMeta = new Tag('meta', { content: String(attrs.highlighted ?? false) });
		const rowStream = renderNodes(resolved.body, config);

		const rowItems = rowStream.tag('div').typeof('ComparisonRow');
		const body = rowItems.wrap('div');

		return createComponentRenderable({
			rune: 'comparison-column',
			tag: 'div',
			properties: {
				highlighted: highlightedMeta,
				row: rowItems,
			},
			refs: {
				body: body.tag('div'),
				name: nameTag,
			},
			children: [nameTag, body.next()],
		});
	},
});

function convertComparisonChildren(
	nodes: unknown[],
	attributes: Record<string, unknown>,
): unknown[] {
	const highlighted = (attributes.highlighted as string) ?? '';

	const converted = headingsToList({ level: 2 })(nodes as Node[]);
	const n = converted.length - 1;
	if (!converted[n] || converted[n].type !== 'list') return nodes;

	const parsedColumns: ParsedColumn[] = [];

	for (const item of converted[n].children) {
		const heading = item.children[0];
		const name = extractText(heading);
		const isHighlighted = name === highlighted;

		const column: ParsedColumn = {
			name,
			highlighted: isHighlighted,
			labeledRows: new Map(),
			secondaryRows: [],
			callouts: [],
		};

		for (let i = 1; i < item.children.length; i++) {
			const child = item.children[i];

			if (child.type === 'list') {
				for (const listItem of child.children) {
					if (listItem.type !== 'item') continue;

					const label = extractBoldLabel(listItem);
					const rowType = detectRowType(listItem);
					const children = getDescriptionChildren(listItem);

					const row: ParsedRow = { label, rowType, children };

					if (label) {
						column.labeledRows.set(label, row);
					} else {
						column.secondaryRows.push(row);
					}
				}
			} else if (child.type === 'blockquote') {
				column.callouts.push({
					label: null,
					rowType: 'callout',
					children: child.children,
				});
			}
		}

		parsedColumns.push(column);
	}

	const masterLabels: string[] = [];
	const seenLabels = new Set<string>();

	for (const col of parsedColumns) {
		for (const label of col.labeledRows.keys()) {
			if (!seenLabels.has(label)) {
				seenLabels.add(label);
				masterLabels.push(label);
			}
		}
	}

	const result: Node[] = converted.slice(0, n);

	result.push(
		new Ast.Node(
			'tag',
			{
				_masterLabels: JSON.stringify(masterLabels),
			},
			[],
			'__comparison-meta',
		),
	);

	for (const col of parsedColumns) {
		const rowNodes: Node[] = [];

		for (const label of masterLabels) {
			const row = col.labeledRows.get(label);
			if (row) {
				rowNodes.push(
					new Ast.Node(
						'tag',
						{
							label,
							rowType: row.rowType,
						},
						row.children,
						'comparison-row',
					),
				);
			} else {
				rowNodes.push(
					new Ast.Node(
						'tag',
						{
							label,
							rowType: 'empty',
						},
						[],
						'comparison-row',
					),
				);
			}
		}

		for (const row of col.secondaryRows) {
			rowNodes.push(
				new Ast.Node(
					'tag',
					{
						label: '',
						rowType: row.rowType,
					},
					row.children,
					'comparison-row',
				),
			);
		}

		for (const row of col.callouts) {
			rowNodes.push(
				new Ast.Node(
					'tag',
					{
						label: '',
						rowType: 'callout',
					},
					row.children,
					'comparison-row',
				),
			);
		}

		result.push(
			new Ast.Node(
				'tag',
				{
					name: col.name,
					highlighted: col.highlighted ? 'true' : 'false',
				},
				rowNodes,
				'comparison-column',
			),
		);
	}

	return result;
}

export { comparisonRow, comparisonColumn };

interface RowData {
	label: string;
	rowType: string;
	body: RenderableTreeNode[];
}
interface ColData {
	name: string;
	highlighted: boolean;
	rows: RowData[];
}

function buildComparisonTable(
	columns: ColData[],
	rowLabels: string[],
	labelsPosition: string,
): InstanceType<typeof Tag> {
	const headerCells: RenderableTreeNode[] = [];
	if (labelsPosition !== 'hidden')
		headerCells.push(new Tag('th', { class: 'rf-comparison__label-col' }, []));
	for (const col of columns) {
		const thChildren: RenderableTreeNode[] = [col.name];
		if (col.highlighted)
			thChildren.push(
				new Tag('span', { class: 'rf-comparison__recommended-badge' }, ['Recommended']),
			);
		headerCells.push(
			new Tag(
				'th',
				col.highlighted ? { class: 'rf-comparison__col-header--highlighted' } : {},
				thChildren,
			),
		);
	}
	const thead = new Tag('thead', {}, [new Tag('tr', {}, headerCells)]);

	const bodyRows: RenderableTreeNode[] = [];
	for (let i = 0; i < rowLabels.length; i++) {
		const cells: RenderableTreeNode[] = [];
		if (labelsPosition !== 'hidden')
			cells.push(
				new Tag('th', { class: 'rf-comparison__row-label', scope: 'row' }, [rowLabels[i]]),
			);
		for (const col of columns) {
			const row = col.rows[i];
			const rType = row ? row.rowType : 'empty';
			const body = row ? row.body : [];

			let cellCls = 'rf-comparison__cell';
			if (col.highlighted) cellCls += ' rf-comparison__cell--highlighted';
			if (rType === 'empty') cellCls += ' rf-comparison__cell--empty';

			const cellChildren: RenderableTreeNode[] = [];
			if (rType === 'check') {
				cellChildren.push(
					new Tag(
						'span',
						{
							class: 'rf-comparison__row-icon rf-comparison__row-icon--check',
							'aria-label': 'Supported',
						},
						['✓'],
					),
				);
			} else if (rType === 'cross') {
				cellChildren.push(
					new Tag(
						'span',
						{
							class: 'rf-comparison__row-icon rf-comparison__row-icon--cross',
							'aria-label': 'Not supported',
						},
						['✗'],
					),
				);
			} else if (rType === 'negative' && body.length) {
				cellChildren.push(new Tag('span', { class: 'rf-comparison__negative' }, body));
			} else if (rType === 'empty') {
				cellChildren.push(
					new Tag('span', { class: 'rf-comparison__cell--empty', 'aria-label': 'Not applicable' }, [
						'—',
					]),
				);
			} else if (rType === 'callout' && body.length) {
				cellChildren.push(new Tag('span', { class: 'rf-comparison__callout-badge' }, body));
			} else if (body.length) {
				cellChildren.push(...body);
			}

			cells.push(new Tag('td', { class: cellCls }, cellChildren));
		}
		bodyRows.push(new Tag('tr', {}, cells));
	}
	const tbody = new Tag('tbody', {}, bodyRows);

	return new Tag('div', { class: 'rf-comparison__table-wrapper' }, [
		new Tag('table', { class: 'rf-comparison__table' }, [thead, tbody]),
	]);
}

function buildComparisonCards(columns: ColData[]): InstanceType<typeof Tag> {
	const cards = columns.map((col) => {
		const cardCls = col.highlighted
			? 'rf-comparison-card rf-comparison-card--highlighted'
			: 'rf-comparison-card';
		const cardChildren: RenderableTreeNode[] = [];
		if (col.highlighted)
			cardChildren.push(new Tag('div', { class: 'rf-comparison-card__badge' }, ['Recommended']));
		cardChildren.push(new Tag('h3', { class: 'rf-comparison-card__name' }, [col.name]));

		const rowItems: RenderableTreeNode[] = [];
		for (const row of col.rows) {
			const rType = row.rowType || 'text';
			if (rType === 'empty') continue;
			const label = row.label;
			const body = row.body;

			let liCls = 'rf-comparison-card__row';
			if (rType === 'negative') liCls += ' rf-comparison-card__row--negative';
			if (rType === 'callout') liCls += ' rf-comparison-card__row--callout';

			const liChildren: RenderableTreeNode[] = [];
			if (rType === 'check') {
				liChildren.push(
					new Tag(
						'span',
						{
							class: 'rf-comparison__row-icon rf-comparison__row-icon--check',
							'aria-label': 'Supported',
						},
						['✓'],
					),
				);
				if (label) liChildren.push(new Tag('strong', {}, [label]));
				liChildren.push(...body);
			} else if (rType === 'cross') {
				liChildren.push(
					new Tag(
						'span',
						{
							class: 'rf-comparison__row-icon rf-comparison__row-icon--cross',
							'aria-label': 'Not supported',
						},
						['✗'],
					),
				);
				if (label) liChildren.push(new Tag('strong', {}, [label]));
				liChildren.push(...body);
			} else if (rType === 'negative') {
				if (label) liChildren.push(new Tag('strong', {}, [label]));
				if (body.length)
					liChildren.push(new Tag('span', { class: 'rf-comparison__negative' }, body));
			} else if (rType === 'callout') {
				liChildren.push(new Tag('div', { class: 'rf-comparison__callout-badge' }, body));
			} else {
				if (label) liChildren.push(new Tag('strong', {}, [label]));
				liChildren.push(...body);
			}

			rowItems.push(new Tag('li', { class: liCls }, liChildren));
		}

		cardChildren.push(new Tag('ul', { class: 'rf-comparison-card__rows' }, rowItems));
		return new Tag('div', { class: cardCls }, cardChildren);
	});

	return new Tag('div', { class: 'rf-comparison__cards' }, cards);
}

export const comparison = createContentModelSchema({
	attributes: {
		title: {
			type: String,
			required: false,
			description: 'Heading displayed above the comparison table',
		},
		highlighted: {
			type: String,
			required: false,
			description: 'Column name to visually emphasize as the recommended choice',
		},
		layout: {
			type: String,
			required: false,
			description: 'Display format for the comparison (e.g. table)',
		},
		labels: {
			type: String,
			required: false,
			description: 'Position of row labels: left column or hidden',
		},
		collapse: {
			type: Boolean,
			required: false,
			description: 'Whether rows collapse into an accordion on small screens',
		},
		verdict: {
			type: String,
			required: false,
			description: 'Summary text shown below the table as a final recommendation',
		},
	},
	contentModel: {
		type: 'custom',
		processChildren: convertComparisonChildren,
		description:
			'Multi-pass heading+list parser with cross-column row alignment. ' +
			'Converts headings to columns, list items to rows with bold labels for alignment, ' +
			'blockquotes to callouts, and builds a master label list for cross-column row matching.',
	},
	transform(resolved, attrs, config) {
		const allChildren = asNodes(resolved.children);

		let masterLabels: string[] = [];
		const columnAst: Node[] = [];
		for (const child of allChildren) {
			if (child.type === 'tag' && (child as any).tag === '__comparison-meta') {
				masterLabels = JSON.parse(child.attributes._masterLabels || '[]');
			} else if (child.type === 'tag' && (child as any).tag === 'comparison-column') {
				columnAst.push(child);
			}
		}

		const layout = (attrs.layout as string) ?? 'table';
		const labelsPosition = (attrs.labels as string) ?? 'left';
		const verdict = (attrs.verdict as string) ?? '';
		const title = (attrs.title as string) ?? '';

		const columns: ColData[] = columnAst.map((colTag) => ({
			name: (colTag.attributes.name as string) ?? '',
			highlighted: colTag.attributes.highlighted === 'true',
			rows: colTag.children
				.filter((c) => c.type === 'tag' && (c as any).tag === 'comparison-row')
				.map((rowTag) => ({
					label: (rowTag.attributes.label as string) ?? '',
					rowType: (rowTag.attributes.rowType as string) ?? 'text',
					body: Markdoc.transform(rowTag.children, config) as RenderableTreeNode[],
				})),
		}));

		const layoutMeta = new Tag('meta', { content: layout });

		const children: RenderableTreeNode[] = [];
		if (title) children.push(new Tag('h2', { class: 'rf-comparison__title' }, [title]));
		children.push(
			layout === 'cards'
				? buildComparisonCards(columns)
				: buildComparisonTable(columns, masterLabels, labelsPosition),
		);
		if (verdict) children.push(new Tag('p', { class: 'rf-comparison__verdict' }, [verdict]));

		return createComponentRenderable({
			rune: 'comparison',
			tag: 'section',
			properties: {
				layout: layoutMeta,
			},
			children,
		});
	},
});

View plugins/marketing/src/tags/comparison.ts on GitHub

Compares products, plans or approaches side by side, feature by feature, as a table or as cards.

Basic usage

Each ## heading is a column. Items with the same bold label line up in the same row across columns.

{% comparison title="Choosing a Framework" %}

## SvelteKit

- **Learning curve** — Low, intuitive template syntax
- **Bundle size** — Compiles away the framework
- **SSR** — Built-in with adapter system
- **TypeScript** — First-class support

## Next.js

- **Learning curve** — Moderate, React knowledge required
- **Bundle size** — Medium, React runtime included
- **SSR** — Built-in with multiple strategies
- **TypeScript** — First-class support

## Astro

- **Learning curve** — Low, HTML-first approach
- **Bundle size** — Zero JS by default
- **SSR** — Built-in, island architecture
- **TypeScript** — First-class support

{% /comparison %}
<section data-rune="comparison" data-rune-fields="{&quot;layout&quot;:&quot;table&quot;}">
  <h2 class="rf-comparison__title">Choosing a Framework</h2>
  <div class="rf-comparison__table-wrapper">
    <table class="rf-comparison__table">
      <thead>
        <tr>
          <th class="rf-comparison__label-col"></th>
          <th>SvelteKit</th>
          <th>Next.js</th>
          <th>Astro</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th class="rf-comparison__row-label" scope="row">Learning curve</th>
          <td class="rf-comparison__cell">
            <p>Low, intuitive template syntax</p>
          </td>
          <td class="rf-comparison__cell">
            <p>Moderate, React knowledge required</p>
          </td>
          <td class="rf-comparison__cell">
            <p>Low, HTML-first approach</p>
          </td>
        </tr>
        <tr>
          <th class="rf-comparison__row-label" scope="row">Bundle size</th>
          <td class="rf-comparison__cell">
            <p>Compiles away the framework</p>
          </td>
          <td class="rf-comparison__cell">
            <p>Medium, React runtime included</p>
          </td>
          <td class="rf-comparison__cell">
            <p>Zero JS by default</p>
          </td>
        </tr>
        <tr>
          <th class="rf-comparison__row-label" scope="row">SSR</th>
          <td class="rf-comparison__cell">
            <p>Built-in with adapter system</p>
          </td>
          <td class="rf-comparison__cell">
            <p>Built-in with multiple strategies</p>
          </td>
          <td class="rf-comparison__cell">
            <p>Built-in, island architecture</p>
          </td>
        </tr>
        <tr>
          <th class="rf-comparison__row-label" scope="row">TypeScript</th>
          <td class="rf-comparison__cell">
            <p>First-class support</p>
          </td>
          <td class="rf-comparison__cell">
            <p>First-class support</p>
          </td>
          <td class="rf-comparison__cell">
            <p>First-class support</p>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</section>

Choosing a Framework

SvelteKitNext.jsAstro
Learning curve

Low, intuitive template syntax

Moderate, React knowledge required

Low, HTML-first approach

Bundle size

Compiles away the framework

Medium, React runtime included

Zero JS by default

SSR

Built-in with adapter system

Built-in with multiple strategies

Built-in, island architecture

TypeScript

First-class support

First-class support

First-class support

<section class="rf-comparison rf-comparison--table" data-layout="table" data-rune="comparison" data-density="full">
  <h2 class="rf-comparison__title">Choosing a Framework</h2>
  <div class="rf-comparison__table-wrapper">
    <table class="rf-comparison__table">
      <thead>
        <tr>
          <th class="rf-comparison__label-col"></th>
          <th>SvelteKit</th>
          <th>Next.js</th>
          <th>Astro</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th class="rf-comparison__row-label" scope="row">Learning curve</th>
          <td class="rf-comparison__cell">
            <p>Low, intuitive template syntax</p>
          </td>
          <td class="rf-comparison__cell">
            <p>Moderate, React knowledge required</p>
          </td>
          <td class="rf-comparison__cell">
            <p>Low, HTML-first approach</p>
          </td>
        </tr>
        <tr>
          <th class="rf-comparison__row-label" scope="row">Bundle size</th>
          <td class="rf-comparison__cell">
            <p>Compiles away the framework</p>
          </td>
          <td class="rf-comparison__cell">
            <p>Medium, React runtime included</p>
          </td>
          <td class="rf-comparison__cell">
            <p>Zero JS by default</p>
          </td>
        </tr>
        <tr>
          <th class="rf-comparison__row-label" scope="row">SSR</th>
          <td class="rf-comparison__cell">
            <p>Built-in with adapter system</p>
          </td>
          <td class="rf-comparison__cell">
            <p>Built-in with multiple strategies</p>
          </td>
          <td class="rf-comparison__cell">
            <p>Built-in, island architecture</p>
          </td>
        </tr>
        <tr>
          <th class="rf-comparison__row-label" scope="row">TypeScript</th>
          <td class="rf-comparison__cell">
            <p>First-class support</p>
          </td>
          <td class="rf-comparison__cell">
            <p>First-class support</p>
          </td>
          <td class="rf-comparison__cell">
            <p>First-class support</p>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</section>

How Markdown is read

You writeIt becomes
A ## headingA column: the thing being compared
A list item under itA row in that column
Bold text at the start of a list itemThe row's label; items with the same label line up across columns
~~Strikethrough~~ in an itemA limitation or missing capability
An item starting [x] or [ ]A check mark or a cross
A blockquote under a headingA callout badge in that column

Highlighted column

Use the highlighted attribute to visually emphasize a recommended column. Add verdict for a summary below the comparison.

{% comparison highlighted="refrakt.md" verdict="refrakt.md gives you the power of AI without sacrificing ownership or portability." %}

## refrakt.md

- **Content ownership** — Your content stays yours, portable Markdown
- **Theme system** — Switch themes instantly, same content renders differently
- **Output** — Real SvelteKit, not proprietary runtime
- **AI role** — AI generates reusable themes, not throwaway sites

## Wix AI

- **Content ownership** — ~~Content locked in Wix platform~~
- **Theme system** — ~~Templates only~~, no real theme swapping
- **Output** — Proprietary Wix runtime
- **AI role** — AI generates a single site layout

## Framer AI

- **Content ownership** — ~~Content lives in Framer~~
- **Theme system** — ~~Visual-first~~, design tool not content system
- **Output** — Framer runtime
- **AI role** — AI assists with layout and copy

{% /comparison %}
<section data-rune="comparison" data-rune-fields="{&quot;layout&quot;:&quot;table&quot;}">
  <div class="rf-comparison__table-wrapper">
    <table class="rf-comparison__table">
      <thead>
        <tr>
          <th class="rf-comparison__label-col"></th>
          <th class="rf-comparison__col-header--highlighted">
            refrakt.md
            <span class="rf-comparison__recommended-badge">Recommended</span>
          </th>
          <th>Wix AI</th>
          <th>Framer AI</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th class="rf-comparison__row-label" scope="row">Content ownership</th>
          <td class="rf-comparison__cell rf-comparison__cell--highlighted">
            <p>Your content stays yours, portable Markdown</p>
          </td>
          <td class="rf-comparison__cell">
            <span class="rf-comparison__negative">
              <p>
                <s>Content locked in Wix platform</s>
              </p>
            </span>
          </td>
          <td class="rf-comparison__cell">
            <span class="rf-comparison__negative">
              <p>
                <s>Content lives in Framer</s>
              </p>
            </span>
          </td>
        </tr>
        <tr>
          <th class="rf-comparison__row-label" scope="row">Theme system</th>
          <td class="rf-comparison__cell rf-comparison__cell--highlighted">
            <p>Switch themes instantly, same content renders differently</p>
          </td>
          <td class="rf-comparison__cell">
            <span class="rf-comparison__negative">
              <p>
                <s>Templates only</s>
                , no real theme swapping
              </p>
            </span>
          </td>
          <td class="rf-comparison__cell">
            <span class="rf-comparison__negative">
              <p>
                <s>Visual-first</s>
                , design tool not content system
              </p>
            </span>
          </td>
        </tr>
        <tr>
          <th class="rf-comparison__row-label" scope="row">Output</th>
          <td class="rf-comparison__cell rf-comparison__cell--highlighted">
            <p>Real SvelteKit, not proprietary runtime</p>
          </td>
          <td class="rf-comparison__cell">
            <p>Proprietary Wix runtime</p>
          </td>
          <td class="rf-comparison__cell">
            <p>Framer runtime</p>
          </td>
        </tr>
        <tr>
          <th class="rf-comparison__row-label" scope="row">AI role</th>
          <td class="rf-comparison__cell rf-comparison__cell--highlighted">
            <p>AI generates reusable themes, not throwaway sites</p>
          </td>
          <td class="rf-comparison__cell">
            <p>AI generates a single site layout</p>
          </td>
          <td class="rf-comparison__cell">
            <p>AI assists with layout and copy</p>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
  <p class="rf-comparison__verdict">refrakt.md gives you the power of AI without sacrificing ownership or portability.</p>
</section>
refrakt.mdRecommendedWix AIFramer AI
Content ownership

Your content stays yours, portable Markdown

Content locked in Wix platform

Content lives in Framer

Theme system

Switch themes instantly, same content renders differently

Templates only, no real theme swapping

Visual-first, design tool not content system

Output

Real SvelteKit, not proprietary runtime

Proprietary Wix runtime

Framer runtime

AI role

AI generates reusable themes, not throwaway sites

AI generates a single site layout

AI assists with layout and copy

refrakt.md gives you the power of AI without sacrificing ownership or portability.

<section class="rf-comparison rf-comparison--table" data-layout="table" data-rune="comparison" data-density="full">
  <div class="rf-comparison__table-wrapper">
    <table class="rf-comparison__table">
      <thead>
        <tr>
          <th class="rf-comparison__label-col"></th>
          <th class="rf-comparison__col-header--highlighted">
            refrakt.md
            <span class="rf-comparison__recommended-badge">Recommended</span>
          </th>
          <th>Wix AI</th>
          <th>Framer AI</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th class="rf-comparison__row-label" scope="row">Content ownership</th>
          <td class="rf-comparison__cell rf-comparison__cell--highlighted">
            <p>Your content stays yours, portable Markdown</p>
          </td>
          <td class="rf-comparison__cell">
            <span class="rf-comparison__negative">
              <p>
                <s>Content locked in Wix platform</s>
              </p>
            </span>
          </td>
          <td class="rf-comparison__cell">
            <span class="rf-comparison__negative">
              <p>
                <s>Content lives in Framer</s>
              </p>
            </span>
          </td>
        </tr>
        <tr>
          <th class="rf-comparison__row-label" scope="row">Theme system</th>
          <td class="rf-comparison__cell rf-comparison__cell--highlighted">
            <p>Switch themes instantly, same content renders differently</p>
          </td>
          <td class="rf-comparison__cell">
            <span class="rf-comparison__negative">
              <p>
                <s>Templates only</s>
                , no real theme swapping
              </p>
            </span>
          </td>
          <td class="rf-comparison__cell">
            <span class="rf-comparison__negative">
              <p>
                <s>Visual-first</s>
                , design tool not content system
              </p>
            </span>
          </td>
        </tr>
        <tr>
          <th class="rf-comparison__row-label" scope="row">Output</th>
          <td class="rf-comparison__cell rf-comparison__cell--highlighted">
            <p>Real SvelteKit, not proprietary runtime</p>
          </td>
          <td class="rf-comparison__cell">
            <p>Proprietary Wix runtime</p>
          </td>
          <td class="rf-comparison__cell">
            <p>Framer runtime</p>
          </td>
        </tr>
        <tr>
          <th class="rf-comparison__row-label" scope="row">AI role</th>
          <td class="rf-comparison__cell rf-comparison__cell--highlighted">
            <p>AI generates reusable themes, not throwaway sites</p>
          </td>
          <td class="rf-comparison__cell">
            <p>AI generates a single site layout</p>
          </td>
          <td class="rf-comparison__cell">
            <p>AI assists with layout and copy</p>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
  <p class="rf-comparison__verdict">refrakt.md gives you the power of AI without sacrificing ownership or portability.</p>
</section>

Cards layout

Use layout="cards" for side-by-side cards. Ideal for pricing comparisons or when columns have different content lengths.

{% comparison highlighted="Pro" layout="cards" %}

## Free

- **Projects** — 1
- **AI generations** — 5 per month
- **Themes** — Community only
- **Support** — Community forum

## Pro

- **Projects** — Unlimited
- **AI generations** — Unlimited
- **Themes** — Community + Premium
- **Support** — Priority email

## Team

- **Projects** — Unlimited
- **AI generations** — Unlimited
- **Themes** — All + private library
- **Support** — Dedicated Slack

{% /comparison %}
<section data-rune="comparison" data-rune-fields="{&quot;layout&quot;:&quot;cards&quot;}">
  <div class="rf-comparison__cards">
    <div class="rf-comparison-card">
      <h3 class="rf-comparison-card__name">Free</h3>
      <ul class="rf-comparison-card__rows">
        <li class="rf-comparison-card__row">
          <strong>Projects</strong>
          <p>1</p>
        </li>
        <li class="rf-comparison-card__row">
          <strong>AI generations</strong>
          <p>5 per month</p>
        </li>
        <li class="rf-comparison-card__row">
          <strong>Themes</strong>
          <p>Community only</p>
        </li>
        <li class="rf-comparison-card__row">
          <strong>Support</strong>
          <p>Community forum</p>
        </li>
      </ul>
    </div>
    <div class="rf-comparison-card rf-comparison-card--highlighted">
      <div class="rf-comparison-card__badge">Recommended</div>
      <h3 class="rf-comparison-card__name">Pro</h3>
      <ul class="rf-comparison-card__rows">
        <li class="rf-comparison-card__row">
          <strong>Projects</strong>
          <p>Unlimited</p>
        </li>
        <li class="rf-comparison-card__row">
          <strong>AI generations</strong>
          <p>Unlimited</p>
        </li>
        <li class="rf-comparison-card__row">
          <strong>Themes</strong>
          <p>Community + Premium</p>
        </li>
        <li class="rf-comparison-card__row">
          <strong>Support</strong>
          <p>Priority email</p>
        </li>
      </ul>
    </div>
    <div class="rf-comparison-card">
      <h3 class="rf-comparison-card__name">Team</h3>
      <ul class="rf-comparison-card__rows">
        <li class="rf-comparison-card__row">
          <strong>Projects</strong>
          <p>Unlimited</p>
        </li>
        <li class="rf-comparison-card__row">
          <strong>AI generations</strong>
          <p>Unlimited</p>
        </li>
        <li class="rf-comparison-card__row">
          <strong>Themes</strong>
          <p>All + private library</p>
        </li>
        <li class="rf-comparison-card__row">
          <strong>Support</strong>
          <p>Dedicated Slack</p>
        </li>
      </ul>
    </div>
  </div>
</section>

Free

  • Projects

    1

  • AI generations

    5 per month

  • Themes

    Community only

  • Support

    Community forum

Recommended

Pro

  • Projects

    Unlimited

  • AI generations

    Unlimited

  • Themes

    Community + Premium

  • Support

    Priority email

Team

  • Projects

    Unlimited

  • AI generations

    Unlimited

  • Themes

    All + private library

  • Support

    Dedicated Slack

<section class="rf-comparison rf-comparison--cards" data-layout="cards" data-rune="comparison" data-density="full">
  <div class="rf-comparison__cards">
    <div class="rf-comparison-card">
      <h3 class="rf-comparison-card__name">Free</h3>
      <ul class="rf-comparison-card__rows">
        <li class="rf-comparison-card__row">
          <strong>Projects</strong>
          <p>1</p>
        </li>
        <li class="rf-comparison-card__row">
          <strong>AI generations</strong>
          <p>5 per month</p>
        </li>
        <li class="rf-comparison-card__row">
          <strong>Themes</strong>
          <p>Community only</p>
        </li>
        <li class="rf-comparison-card__row">
          <strong>Support</strong>
          <p>Community forum</p>
        </li>
      </ul>
    </div>
    <div class="rf-comparison-card rf-comparison-card--highlighted">
      <div class="rf-comparison-card__badge">Recommended</div>
      <h3 class="rf-comparison-card__name">Pro</h3>
      <ul class="rf-comparison-card__rows">
        <li class="rf-comparison-card__row">
          <strong>Projects</strong>
          <p>Unlimited</p>
        </li>
        <li class="rf-comparison-card__row">
          <strong>AI generations</strong>
          <p>Unlimited</p>
        </li>
        <li class="rf-comparison-card__row">
          <strong>Themes</strong>
          <p>Community + Premium</p>
        </li>
        <li class="rf-comparison-card__row">
          <strong>Support</strong>
          <p>Priority email</p>
        </li>
      </ul>
    </div>
    <div class="rf-comparison-card">
      <h3 class="rf-comparison-card__name">Team</h3>
      <ul class="rf-comparison-card__rows">
        <li class="rf-comparison-card__row">
          <strong>Projects</strong>
          <p>Unlimited</p>
        </li>
        <li class="rf-comparison-card__row">
          <strong>AI generations</strong>
          <p>Unlimited</p>
        </li>
        <li class="rf-comparison-card__row">
          <strong>Themes</strong>
          <p>All + private library</p>
        </li>
        <li class="rf-comparison-card__row">
          <strong>Support</strong>
          <p>Dedicated Slack</p>
        </li>
      </ul>
    </div>
  </div>
</section>

Attributes

AttributeTypeRequiredDescription
titlestring—Heading displayed above the comparison table
highlightedstring—Column name to visually emphasize as the recommended choice
layoutstring—Display format for the comparison (e.g. table)
labelsstring—Position of row labels: left column or hidden
collapseboolean—Whether rows collapse into an accordion on small screens
verdictstring—Summary text shown below the table as a final recommendation

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

comparison-column

AttributeTypeRequiredDescription
namestring—
highlightedboolean—

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

comparison-row

AttributeTypeRequiredDescription
labelstring—
rowTypestring—

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