Business›Cast / Team

business

Cast / Team

People directory for team pages and speaker lineups

Install

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

About the plugin and its runes

Source

import Markdoc from '@markdoc/markdoc';
import type { RenderableTreeNode } from '@markdoc/markdoc';
const { Tag } = Markdoc;
import {
	createComponentRenderable,
	createContentModelSchema,
	bodyOnly,
	asNodes,
	renderNodes,
	pageSectionProperties,
	resolveImageScheme,
	LAYOUT,
	layoutMatches,
} from '@refrakt-md/runes';
import { RenderableNodeCursor } from '@refrakt-md/runes';

export const castMemberSchema = {
	type: 'Person',
	properties: { name: 'name', role: 'jobTitle', portrait: 'image' },
} as const;

export const castMember = createContentModelSchema({
	schema: castMemberSchema,
	attributes: {
		name: { type: String, required: false, description: 'Display name of the cast member.' },
		role: { type: String, required: false, description: 'Job title or role held by this member.' },
		image: { type: String, required: false, description: 'Portrait image URL.' },
	},
	contentModel: bodyOnly(),
	transform(resolved, attrs, config) {
		const nameTag = new Tag('span', {}, [attrs.name ?? '']);
		const roleTag = new Tag('span', {}, [attrs.role ?? '']);
		const body = renderNodes(resolved.body, config).wrap('div');

		const children: any[] = [];

		let portraitTag: Markdoc.Tag | undefined;
		if (attrs.image) {
			const resolved = resolveImageScheme(attrs.image as string, { alt: attrs.name ?? '', config });
			portraitTag = resolved ?? new Tag('img', { src: attrs.image, alt: attrs.name ?? '' });
			children.push(portraitTag);
		}

		children.push(nameTag, roleTag, body.next());

		return createComponentRenderable({
			rune: 'cast-member',
			tag: 'li',
			refs: {
				name: nameTag,
				role: roleTag,
				body: body.tag('div'),
				portrait: portraitTag,
			},
			children,
		});
	},
});

export const castSections = {
	preamble: 'preamble',
	headline: 'title',
	blurb: 'description',
} as const;

export const cast = createContentModelSchema({
	sections: castSections,
	attributes: {
		layout: {
			type: String,
			required: false,
			matches: layoutMatches([LAYOUT.grid, LAYOUT.list, LAYOUT.carousel]),
			description:
				'Visual arrangement of members: grid (cards), list (compact roster), or carousel (scroll-snap track).',
		},
	},
	contentModel: {
		type: 'sequence' as const,
		fields: [
			{ name: 'header', match: 'heading|paragraph|image', optional: true, greedy: true },
			{
				name: 'members',
				match: 'list',
				optional: true,
				greedy: true,
				itemModel: {
					fields: [
						{ name: 'image', match: 'image' as const, optional: true, extract: 'src' },
						{ name: 'role', match: 'text' as const, pattern: /\s*[-–—]\s*(.+)$/, optional: true },
						{ name: 'name', match: 'text' as const, pattern: 'remainder' as const },
					],
				},
				emitTag: 'cast-member',
				emitAttributes: { name: '$name', role: '$role', image: '$image' },
			} as any,
			{ name: 'items', match: 'tag', optional: true, greedy: true },
		],
	},
	transform(resolved, attrs, config) {
		const header = renderNodes(resolved.header, config);
		const allMembers = [...asNodes(resolved.members), ...asNodes(resolved.items)];
		const body = new RenderableNodeCursor(
			Markdoc.transform(allMembers, config) as RenderableTreeNode[],
		);

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

		const members = body.tag('li').typeof('CastMember');
		const membersList = new Tag(
			'ul',
			attrs.layout === 'list' ? { 'data-zone-layout': 'ladder' } : {},
			members.toArray(),
		);

		const children: any[] = [];
		if (header.count() > 0) {
			children.push(header.wrap('header').next());
		}
		children.push(membersList);

		return createComponentRenderable({
			rune: 'cast',
			tag: 'section',
			properties: {
				member: members,
				layout: layoutMeta,
			},
			refs: { ...pageSectionProperties(header), items: membersList },
			children,
		});
	},
});

View plugins/business/src/tags/cast.ts on GitHub

A people directory for team pages, speaker lineups and contributor lists. To describe the organization itself, with its name, logo and contact details, use organization.

Basic usage

{% cast layout="grid" %}
- Alice Johnson - CEO
  ![Alice Johnson](https://assets.refrakt.md/team-alice-johnson.png)
- Bob Smith - CTO
  ![Bob Smith](https://assets.refrakt.md/team-bob-smith.png)
- Carol Williams - Head of Design
- David Chen - Lead Engineer
{% /cast %}
<section data-rune="cast" data-rune-fields="{&quot;layout&quot;:&quot;grid&quot;}">
  <ul data-name="items">
    <li data-rune="cast-member" typeof="Person" data-field="member">
      <img src="https://assets.refrakt.md/team-alice-johnson.png" alt="Alice Johnson" data-name="portrait" property="image">
      <span data-name="name" property="name">Alice Johnson</span>
      <span data-name="role" property="jobTitle">CEO</span>
      <div data-name="body"></div>
    </li>
    <li data-rune="cast-member" typeof="Person" data-field="member">
      <img src="https://assets.refrakt.md/team-bob-smith.png" alt="Bob Smith" data-name="portrait" property="image">
      <span data-name="name" property="name">Bob Smith</span>
      <span data-name="role" property="jobTitle">CTO</span>
      <div data-name="body"></div>
    </li>
    <li data-rune="cast-member" typeof="Person" data-field="member">
      <span data-name="name" property="name">Carol Williams</span>
      <span data-name="role" property="jobTitle">Head of Design</span>
      <div data-name="body"></div>
    </li>
    <li data-rune="cast-member" typeof="Person" data-field="member">
      <span data-name="name" property="name">David Chen</span>
      <span data-name="role" property="jobTitle">Lead Engineer</span>
      <div data-name="body"></div>
    </li>
  </ul>
</section>
  • Alice JohnsonAlice JohnsonCEO
  • Bob SmithBob SmithCTO
  • Carol WilliamsHead of Design
  • David ChenLead Engineer
<section class="rf-cast rf-cast--grid" data-layout="grid" data-rune="cast" data-density="full">
  <ul data-name="items" class="rf-cast__items">
    <li class="rf-cast-member" typeof="Person" data-field="member" data-elevation="flat" data-rune="cast-member" data-density="full">
      <img src="https://assets.refrakt.md/team-alice-johnson.png" alt="Alice Johnson" data-name="portrait" property="image" class="rf-cast-member__portrait" />
      <span data-name="name" property="name" class="rf-cast-member__name">Alice Johnson</span>
      <span data-name="role" property="jobTitle" class="rf-cast-member__role">CEO</span>
      <div data-name="body" class="rf-cast-member__body"></div>
    </li>
    <li class="rf-cast-member" typeof="Person" data-field="member" data-elevation="flat" data-rune="cast-member" data-density="full">
      <img src="https://assets.refrakt.md/team-bob-smith.png" alt="Bob Smith" data-name="portrait" property="image" class="rf-cast-member__portrait" />
      <span data-name="name" property="name" class="rf-cast-member__name">Bob Smith</span>
      <span data-name="role" property="jobTitle" class="rf-cast-member__role">CTO</span>
      <div data-name="body" class="rf-cast-member__body"></div>
    </li>
    <li class="rf-cast-member" typeof="Person" data-field="member" data-elevation="flat" data-rune="cast-member" data-density="full">
      <span data-name="name" property="name" class="rf-cast-member__name">Carol Williams</span>
      <span data-name="role" property="jobTitle" class="rf-cast-member__role">Head of Design</span>
      <div data-name="body" class="rf-cast-member__body"></div>
    </li>
    <li class="rf-cast-member" typeof="Person" data-field="member" data-elevation="flat" data-rune="cast-member" data-density="full">
      <span data-name="name" property="name" class="rf-cast-member__name">David Chen</span>
      <span data-name="role" property="jobTitle" class="rf-cast-member__role">Lead Engineer</span>
      <div data-name="body" class="rf-cast-member__body"></div>
    </li>
  </ul>
</section>

How Markdown is read

You writeIt becomes
A short paragraph, then a heading and a paragraph, before the listThe eyebrow, headline and blurb (Page sections)
A list item Name - RoleA member; the text after the dash is their role
An image in a list itemThat member's portrait

List layout

Use layout="list" for a denser, single-column directory.

{% cast layout="list" %}
- Alice Johnson - CEO
  ![Alice Johnson](https://assets.refrakt.md/team-alice-johnson.png)
- Bob Smith - CTO
  ![Bob Smith](https://assets.refrakt.md/team-bob-smith.png)
- Carol Williams - Head of Design
- David Chen - Lead Engineer
{% /cast %}
<section data-rune="cast" data-rune-fields="{&quot;layout&quot;:&quot;list&quot;}">
  <ul data-zone-layout="ladder" data-name="items">
    <li data-rune="cast-member" typeof="Person" data-field="member">
      <img src="https://assets.refrakt.md/team-alice-johnson.png" alt="Alice Johnson" data-name="portrait" property="image">
      <span data-name="name" property="name">Alice Johnson</span>
      <span data-name="role" property="jobTitle">CEO</span>
      <div data-name="body"></div>
    </li>
    <li data-rune="cast-member" typeof="Person" data-field="member">
      <img src="https://assets.refrakt.md/team-bob-smith.png" alt="Bob Smith" data-name="portrait" property="image">
      <span data-name="name" property="name">Bob Smith</span>
      <span data-name="role" property="jobTitle">CTO</span>
      <div data-name="body"></div>
    </li>
    <li data-rune="cast-member" typeof="Person" data-field="member">
      <span data-name="name" property="name">Carol Williams</span>
      <span data-name="role" property="jobTitle">Head of Design</span>
      <div data-name="body"></div>
    </li>
    <li data-rune="cast-member" typeof="Person" data-field="member">
      <span data-name="name" property="name">David Chen</span>
      <span data-name="role" property="jobTitle">Lead Engineer</span>
      <div data-name="body"></div>
    </li>
  </ul>
</section>
  • Alice JohnsonAlice JohnsonCEO
  • Bob SmithBob SmithCTO
  • Carol WilliamsHead of Design
  • David ChenLead Engineer
<section class="rf-cast rf-cast--list" data-layout="list" data-rune="cast" data-density="full">
  <ul data-zone-layout="ladder" data-name="items" class="rf-cast__items">
    <li class="rf-cast-member" typeof="Person" data-field="member" data-elevation="flat" data-rune="cast-member" data-density="full">
      <img src="https://assets.refrakt.md/team-alice-johnson.png" alt="Alice Johnson" data-name="portrait" property="image" class="rf-cast-member__portrait" />
      <span data-name="name" property="name" class="rf-cast-member__name">Alice Johnson</span>
      <span data-name="role" property="jobTitle" class="rf-cast-member__role">CEO</span>
      <div data-name="body" class="rf-cast-member__body"></div>
    </li>
    <li class="rf-cast-member" typeof="Person" data-field="member" data-elevation="flat" data-rune="cast-member" data-density="full">
      <img src="https://assets.refrakt.md/team-bob-smith.png" alt="Bob Smith" data-name="portrait" property="image" class="rf-cast-member__portrait" />
      <span data-name="name" property="name" class="rf-cast-member__name">Bob Smith</span>
      <span data-name="role" property="jobTitle" class="rf-cast-member__role">CTO</span>
      <div data-name="body" class="rf-cast-member__body"></div>
    </li>
    <li class="rf-cast-member" typeof="Person" data-field="member" data-elevation="flat" data-rune="cast-member" data-density="full">
      <span data-name="name" property="name" class="rf-cast-member__name">Carol Williams</span>
      <span data-name="role" property="jobTitle" class="rf-cast-member__role">Head of Design</span>
      <div data-name="body" class="rf-cast-member__body"></div>
    </li>
    <li class="rf-cast-member" typeof="Person" data-field="member" data-elevation="flat" data-rune="cast-member" data-density="full">
      <span data-name="name" property="name" class="rf-cast-member__name">David Chen</span>
      <span data-name="role" property="jobTitle" class="rf-cast-member__role">Lead Engineer</span>
      <div data-name="body" class="rf-cast-member__body"></div>
    </li>
  </ul>
</section>

Explicit members

Use {% cast-member %} tags for more control, including bios.

{% cast %}
	{% cast-member name="Alice Johnson" role="CEO" %}
	Alice opened the first Acme café in 2015 and still cups every new roast.
	{% /cast-member %}

	{% cast-member name="Bob Smith" role="CTO" %}
	Bob built the ordering app and runs the team behind the coffee subscription.
	{% /cast-member %}
{% /cast %}
<section data-rune="cast" data-rune-fields="{&quot;layout&quot;:&quot;grid&quot;}">
  <ul data-name="items">
    <li data-rune="cast-member" typeof="Person" data-field="member">
      <span data-name="name" property="name">Alice Johnson</span>
      <span data-name="role" property="jobTitle">CEO</span>
      <div data-name="body">
        <p>Alice opened the first Acme café in 2015 and still cups every new roast.</p>
      </div>
    </li>
    <li data-rune="cast-member" typeof="Person" data-field="member">
      <span data-name="name" property="name">Bob Smith</span>
      <span data-name="role" property="jobTitle">CTO</span>
      <div data-name="body">
        <p>Bob built the ordering app and runs the team behind the coffee subscription.</p>
      </div>
    </li>
  </ul>
</section>
  • Alice JohnsonCEO

    Alice opened the first Acme café in 2015 and still cups every new roast.

  • Bob SmithCTO

    Bob built the ordering app and runs the team behind the coffee subscription.

<section class="rf-cast rf-cast--grid" data-layout="grid" data-rune="cast" data-density="full">
  <ul data-name="items" class="rf-cast__items">
    <li class="rf-cast-member" typeof="Person" data-field="member" data-elevation="flat" data-rune="cast-member" data-density="full">
      <span data-name="name" property="name" class="rf-cast-member__name">Alice Johnson</span>
      <span data-name="role" property="jobTitle" class="rf-cast-member__role">CEO</span>
      <div data-name="body" class="rf-cast-member__body">
        <p>Alice opened the first Acme café in 2015 and still cups every new roast.</p>
      </div>
    </li>
    <li class="rf-cast-member" typeof="Person" data-field="member" data-elevation="flat" data-rune="cast-member" data-density="full">
      <span data-name="name" property="name" class="rf-cast-member__name">Bob Smith</span>
      <span data-name="role" property="jobTitle" class="rf-cast-member__role">CTO</span>
      <div data-name="body" class="rf-cast-member__body">
        <p>Bob built the ordering app and runs the team behind the coffee subscription.</p>
      </div>
    </li>
  </ul>
</section>

Attributes

AttributeTypeRequiredDescription
layout"grid" | "list" | "carousel"—Visual arrangement of members: grid (cards), list (compact roster), or carousel (scroll-snap track).

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

cast-member

AttributeTypeRequiredDescription
namestring—Display name of the cast member.
rolestring—Job title or role held by this member.
imagestring—Portrait image URL.

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