Sections & blocks›Hint

core

Hint

Callouts and admonitions for supplementary information

Source

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

const hintType = ['caution', 'check', 'note', 'warning'] as const;

export const hintSections = { header: 'header' } as const;

export const hint = createContentModelSchema({
	sections: hintSections,
	attributes: {
		type: {
			type: String,
			matches: hintType.slice(),
			errorLevel: 'critical',
			description: 'Visual style: caution, check, note, or warning',
		},
	},
	contentModel: bodyOnly(),
	transform(resolved, attrs, config) {
		const hintType = new Tag('meta', { content: attrs.type ?? 'note' });
		const body = renderNodes(resolved.body, config);
		const bodyDiv = body.wrap('div');

		return createComponentRenderable({
			rune: 'hint',
			tag: 'section',
			properties: {
				hintType,
			},
			refs: {
				body: bodyDiv.tag('div'),
			},
			children: [bodyDiv.next()],
		});
	},
});

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

Callouts and admonitions. Supports four types: note, warning, caution, and check. For an aside that sits in the margin or as a footnote rather than in the flow, use sidenote; to attach notes to particular passages of a longer text, use annotate.

Basic usage

Display supplementary information with a visual callout.

{% hint type="note" %}
The staging site rebuilds on every push to `main`, so a change can take a few minutes to appear.
{% /hint %}
<section data-rune="hint" data-rune-fields="{&quot;hintType&quot;:&quot;note&quot;}">
  <div data-name="body">
    <p>
      The staging site rebuilds on every push to
      <code>main</code>
      , so a change can take a few minutes to appear.
    </p>
  </div>
</section>
note

The staging site rebuilds on every push to main, so a change can take a few minutes to appear.

<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>
      The staging site rebuilds on every push to 
      <code>main</code>
      , so a change can take a few minutes to appear.
    </p>
  </div>
</section>

All hint types

Use different types to convey different levels of importance.

{% hint type="note" %}
Exports include archived projects unless you clear **Include archived**.
{% /hint %}

{% hint type="warning" %}
Renaming a workspace changes its URL. Update any bookmarks and webhooks that point at the old one.
{% /hint %}

{% hint type="caution" %}
Deleting a workspace removes every project in it. This cannot be undone.
{% /hint %}

{% hint type="check" %}
Your export is ready. The download link stays valid for seven days.
{% /hint %}
<section data-rune="hint" data-rune-fields="{&quot;hintType&quot;:&quot;note&quot;}">
  <div data-name="body">
    <p>
      Exports include archived projects unless you clear
      <strong marker="**">Include archived</strong>
      .
    </p>
  </div>
</section>
<section data-rune="hint" data-rune-fields="{&quot;hintType&quot;:&quot;warning&quot;}">
  <div data-name="body">
    <p>Renaming a workspace changes its URL. Update any bookmarks and webhooks that point at the old one.</p>
  </div>
</section>
<section data-rune="hint" data-rune-fields="{&quot;hintType&quot;:&quot;caution&quot;}">
  <div data-name="body">
    <p>Deleting a workspace removes every project in it. This cannot be undone.</p>
  </div>
</section>
<section data-rune="hint" data-rune-fields="{&quot;hintType&quot;:&quot;check&quot;}">
  <div data-name="body">
    <p>Your export is ready. The download link stays valid for seven days.</p>
  </div>
</section>
note

Exports include archived projects unless you clear Include archived.

warning

Renaming a workspace changes its URL. Update any bookmarks and webhooks that point at the old one.

caution

Deleting a workspace removes every project in it. This cannot be undone.

check

Your export is ready. The download link stays valid for seven days.

<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>
      Exports include archived projects unless you clear 
      <strong marker="**">Include archived</strong>
      .
    </p>
  </div>
</section>
<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>Renaming a workspace changes its URL. Update any bookmarks and webhooks that point at the old one.</p>
  </div>
</section>
<section class="rf-hint rf-hint--caution" data-hint-type="caution" 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="caution"></span>
      <span data-meta-value="">caution</span>
    </span>
  </div>
  <div data-name="body" class="rf-hint__body">
    <p>Deleting a workspace removes every project in it. This cannot be undone.</p>
  </div>
</section>
<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 export is ready. The download link stays valid for seven days.</p>
  </div>
</section>

Attributes

AttributeTypeRequiredDescription
type"caution" | "check" | "note" | "warning"—Visual style: caution, check, note, or warning

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

Header emphasis. Scales a rune's header, or its featured quotation; the theme decides the type size for each step.

AttributeTypeRequiredDescription
prominence"quiet" | "normal" | "prominent" | "display" | "marquee"—Emphasis of a page-section header or a featured quotation (only on runes that have one)
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