Layout sample

Every slide layout and element in one deck

awesome-ai-stack · demo

Default layout

A small subtitle under the title — added with ::sub[text]

<Slide> — with no class, the title is pinned to the top (the default slide).

  • unordered list
  • inline: bold, italic, code, link
  1. ordered list
  2. second item

Blockquotes render like this.

Source: awesome-ai-stack docs · example.com/docs

Bullet points

  • The most common slide shape — one key point per line
  • Keep items short and parallel
    • Add supporting detail as a sub-item
    • Indent one more level if needed
  • Emphasize keywords in bold
  • Close with the final point

Numbered steps

  1. Collect — gather the material and data you need
  2. Clean — normalize the format, drop the noise
  3. Arrange — lay it out to match the slide flow
  4. Review — fold in feedback and refine

Use this when order matters — steps and procedures.

Step reveal (steps)

Items inside :::steps appear one at a time as you press →

  • First point — press the arrow to reveal
  • Second point — press again to continue
  • Third point — the next item
  • Once they’re all shown, move to the next slide

A good talk is remembered as a story, not as slides.

— awesome-ai-stack · class="quote"

Stats · numbers

99.9%

uptime

2.5×

faster

44KB

bundle / locale

:::stats — big numbers (###) with labels, as cards. Each heading starts a new card.

Callout boxes

Note — use :::note for asides and context.

Tip:::tip highlights a useful hint.

Warning:::warning is for cautions and gotchas.

Comparison (compare)

Build your own

  • fully integrated with the site
  • 44KB bundle / locale
  • customize however you like

External tool

  • quick to start
  • separate build & bundle
  • feels bolted-on

:::compare — side-by-side cards for trade-offs.

Center layout

<Slide class="center"> — content is centered vertically and horizontally.

Good for a short emphasis slide or a section divider.

Column layout

:::cols---::: — split into columns in pure Markdown.

Left column

  • item A
  • item B

(### inside a column is a content sub-heading — only each slide’s title goes in the TOC)

Right column

  • item C
  • item D

Table

LayoutSyntaxNote
coverclass="cover"large centered title
background imagebg={img}full-bleed
columns:::colssplit with ---
media splitaas-splitimage · code · diagram
align/fillimg-top·fillvertical position · cover
subtitle · source::sub[…] · source="…"under title · bottom-right
quote · statsclass="quote" · :::statshero quote · number cards
callout · compare:::note/tip/warning · :::compareboxes · side-by-side
steps · compact:::steps · class="compact"reveal one-by-one · natural size
TOC-excludedtoc={false}heading hidden

Tables use standard Markdown syntax. Hover a diagram or image for an Enlarge button, and press o for an overview of every slide. A long diagram scrolls inside its box — aas-split scroll (vertical) or class="scroll-x" (horizontal).

Code

Code slides — basic · left/right split · stacked

Code basic

Code blocks get the same Shiki highlighting as the rest of the site.

async function goToSlide(deck: HTMLElement, i: number) {
  const target = deck.querySelectorAll('.aas-slide')[i];
  deck.scrollLeft = target.offsetLeft; // jump to the snap point
  return i;
}

Code left, text right

function go(deck, i) {
  const s = deck
    .querySelectorAll('.aas-slide');
  deck.scrollLeft = s[i].offsetLeft;
}

Put the code block first and the text after inside aas-split to get code on the left.

  • same split syntax as images
  • long lines scroll inside the code

Text left, code right

Just swap the order — text first, code block after, and the code is on the right.

  • tune the ratio with r-30-70 / r-70-30
function go(deck, i) {
  const s = deck
    .querySelectorAll('.aas-slide');
  deck.scrollLeft = s[i].offsetLeft;
}

Code on top, text below

deck.scrollLeft = slide.offsetLeft; // jump to the snap point

Put the code block first and the caption underneath — no split needed, it just stacks.

Images

Image slides — placement · ratios · alignment · fill

Image on top, text below

AI course background

A large image on top with a short caption underneath. Hover the image for an Enlarge button.

Image: awesome-ai-stack sample asset

Image left, text right (50:50)

AI course background

Put the <Image> first and the text after inside <div class="aas-split"> to get the image on the left.

  • image and text split evenly
  • good for a quick point

Image left, text right (30:70)

AI course background

The r-30-70 modifier makes the image narrow (30%) and the text wide (70%).

Good when the copy is long or the image is just supporting.

Text left, image right (50:50)

Just swap the order — text first, <Image> after, and the image is on the right.

  • evenly split
AI course background

Text left, image right (70:30)

r-70-30 makes the text wide (70%) and the image narrow (30%).

AI course background

Image vertical alignment

Where the image sits in a vertically-filled (tall) slide — img-top · img-center · img-bottom

Against a slide filled vertically, the image can sit at the top, center, or bottom. The next three slides show each.

Top (img-top)

AI course background

img-top — in a vertically-filled slide the image sits at the top.

Center (img-center)

AI course background

img-center — the image is vertically centered (the default).

Bottom (img-bottom)

AI course background

img-bottom — in a vertically-filled slide the image sits at the bottom.

Fill (cover)

fill — a tall image cropped to css cover

AI course background

Add fill and the image fills the slide vertically; the overflow is cropped (object-fit: cover).

Works together with the ratio modifiers (r-30-70, etc.).

Diagrams

Diagram slides — basic · left/right split · stacked

Diagram basic

flowchart LR
  a[Cover] --> b[Layouts]
  b --> c[Images]
  c --> d[Code]
  d --> e[Diagram]

Mermaid diagrams render in the current (light/dark) theme.

Diagram left, text right

flowchart TB
  a[Input] --> b[Process]
  b --> c[Output]

Just like images and code, put the diagram first inside aas-split to place it on the left.

  • a vertical (TB) graph fits a narrow column well
  • the diagram scales down to the column width

Text left, diagram right

Text first, diagram after, and the diagram is on the right.

Here r-70-30 makes the text wide and the diagram narrow.

flowchart TB
  a[Input] --> b[Process]
  b --> c[Output]

Diagram on top, text below

flowchart LR
  a[Plan] --> b[Run] --> c[Verify]

Put the diagram first and the caption underneath — no split, it just stacks.

Complex flowchart

Click to enlarge — if it’s bigger than the screen, scroll inside the lightbox

flowchart TD
  A[User request] --> B{Validate input}
  B -->|valid| C[Classify intent]
  B -->|invalid| Z[Return error]
  C --> D{Tool needed?}
  D -->|yes| E[Select tool]
  D -->|no| F[Answer directly]
  E --> G[Run tool]
  G --> H{Success?}
  H -->|yes| I[Merge result]
  H -->|no| J[Retry / fallback]
  J --> G
  I --> K[Generate response]
  F --> K
  K --> L[Output to user]

Complex flowchart + notes

aas-split scroll — the diagram on the left scrolls vertically inside its column

flowchart TD
  A[User request] --> B{Validate input}
  B -->|valid| C[Classify intent]
  B -->|invalid| Z[Return error]
  C --> D{Tool needed?}
  D -->|yes| E[Select tool]
  D -->|no| F[Answer directly]
  E --> G[Run tool]
  G --> H{Success?}
  H -->|yes| I[Merge result]
  H -->|no| J[Retry / fallback]
  J --> G
  I --> K[Generate response]
  F --> K
  K --> L[Output to user]

How the agent handles a request.

  1. Validate input — invalid requests return an error immediately
  2. Classify intent → decide if a tool is needed
  3. If so, select → run → check success, retry / fall back on failure
  4. Merge the result or answer directly, then output

The diagram is long, so it scrolls vertically inside its column. Click it to enlarge.

Scroll walkthrough

Press → and the flowchart on the left scrolls to that spot while the notes on the right change

flowchart TD
  A[User request] --> B{Validate input}
  B -->|valid| C[Classify intent]
  B -->|invalid| Z[Return error]
  C --> D{Tool needed?}
  D -->|yes| E[Select tool]
  D -->|no| F[Answer directly]
  E --> G[Run tool]
  G --> H{Success?}
  H -->|yes| I[Merge result]
  H -->|no| J[Retry / fallback]
  J --> G
  I --> K[Generate response]
  F --> K
  K --> L[Output to user]

① Validate — check the request is valid, else return an error right away.

② Decide — classify the intent and decide whether a tool is needed.

③ Run & check — run the tool; on success merge the result, on failure retry / fall back.

④ Output — generate the response and hand it to the user.

Diagram + long text (compact)

class="compact" — the diagram keeps its natural size (just padded) and the text flows below

flowchart LR
  a[Collect] --> b[Clean] --> c[Train] --> d[Evaluate]

A normal diagram slide fills the height, but <Slide class="compact"> keeps the diagram at its natural size so you can write a longer explanation underneath.

  • when you walk through each pipeline stage in prose
  • when the diagram is a reference and the text carries the point
  • when you need several paragraphs

Adding paragraphs like this doesn’t push the diagram up — it stays put, with just a little padding around the box.

Wide diagram (horizontal scroll)

class="compact scroll-x" — a wide flowchart keeps its natural size and scrolls sideways inside the box

flowchart LR
  a[Collect] --> b[Clean] --> c[Label] --> d[Extract features] --> e[Train] --> f[Cross-validate] --> g[Evaluate] --> h[Tune] --> i[Deploy] --> j[Monitor]

A flowchart with many stages runs wide; shrinking it to fit makes the labels tiny. With scroll-x the diagram keeps its natural size and the box scrolls horizontally instead.

  • good for data / ML pipelines with many stages
  • every node stays a readable size
  • click it to see the whole thing enlarged in the lightbox

Horizontal scroll walkthrough

Press → and the pipeline above scrolls sideways to that stage while the note below changes

flowchart LR
  a[Collect] --> b[Clean] --> c[Label] --> d[Extract features] --> e[Train] --> f[Cross-validate] --> g[Evaluate] --> h[Tune] --> i[Deploy] --> j[Monitor]

① Prepare data — collect, clean, and label to build the training set.

② Train — extract features and train the model.

③ Evaluate — cross-validate and evaluate, then tune.

④ Operate — deploy, monitor, and retrain when needed.

Image walkthrough

Press → and the image scrolls to that region while the note below changes

AI course background

① Top — start at the top of the image.

② Middle — scroll to the centre.

③ Bottom — all the way down.

Code walkthrough

Press → to scroll the code and highlight the whole line(s) being explained

const SYSTEM = 'You can call tools.';

async function runAgent(input: string) {
  const messages = [
    { role: 'system', content: SYSTEM },
    { role: 'user', content: input },
  ];

  for (let turn = 0; turn < MAX_TURNS; turn++) {
    const res = await model.chat(messages);
    messages.push(res.message);

    if (!res.toolCalls?.length) {
      return res.message.content;
    }

    for (const call of res.toolCalls) {
      const out = await tools[call.name](call.args);
      messages.push({
        role: 'tool',
        content: out,
      });
    }
  }
  throw new Error('max turns exceeded');
}

① Entry — start from the system and user messages.

② Call the model — each turn, call the model and record the reply.

③ Stop condition — with no tool calls, return the result.

④ Run tools — call each tool and feed the output back in.

This heading is not in the TOC

This slide is wrapped in <Slide toc={false}>. Open the TOC (☰) and this heading won’t be listed — the slide itself still pages through normally.

The end

navigate · o overview · click a diagram or image to enlarge

Open src/content/slides/en/sample-layouts/index.mdx to see the syntax.

Slides
1 / 1