The Component Workshop Meet the building blocks02 / 04

SECTION 01 · 6 MIN READ & EXPLORE

Prompts and useful detours

Guide the next action, whether it happens in an article, a video, or an AI conversation.

DEMONSTRATION CONTENT

A prompt should have a purpose

Use the Prompt component to make an AI exercise easy to copy. The learning task should still be clear before the learner opens another tool.

<Prompt
  title="Practice explaining a concept"
  text="Ask me one question about HTTP authentication. Wait for my answer."
/>

Explain why a resource belongs here

A Resource pairs a link with an instruction. Tell learners what to focus on and when they have read enough.

READ Reference

Writing MDX in Astro (opens in a new tab)

Look at how Markdown and components work together. Return here once you can describe when you would use a component instead of plain Markdown.

<Resource
  title="A carefully chosen article"
  href="https://developer.mozilla.org/en-US/docs/Web/HTTP"
  note="Read the overview. Focus on requests and responses."
/>

Video is another kind of resource

Use kind="video" for a video link. Optionally pass its 11-character YouTube embedId to offer a player that starts open and can be collapsed. Video playback requires an internet connection.

WATCH Optional video

HTTP Crash Course & Exploration (opens in a new tab)

A video resource example: watch for the distinction between the client and the server. Use the link or watch the embedded player.

Watch here

The player uses YouTube’s privacy-enhanced embed domain. The rest of the chapter remains usable without playing the video.

Pass items to cycle through related resources with the arrows. Each link can have a cover: use an image in public/ or the page’s social preview image URL. Titles, descriptions, and covers are fetched from page metadata during development or build, then cached locally. Supply any field yourself to override it, or set preview={false} to disable fetching. The explicit cover below is an illustrative placeholder.

READ

Writing MDX in Astro (opens in a new tab)

Look at how Markdown and components work together.

READ

HTTP overview (opens in a new tab)

Follow the path from a request to a response.

<Resource label="Go deeper" items={[
  { title: "First article", href: "https://example.com/one", cover: "/covers/article.jpg", note: "Focus on the diagram." },
  { title: "Second article", href: "https://example.com/two", note: "Compare its explanation with your own." }
]} />

A single Resource can be as simple as <Resource href="https://example.com/article" />, or accept an explicit cover="/covers/article.jpg". List entries support the same properties as a single Resource, including video embeds.

Suggest books without interrupting the chapter

A Books card shows one title and cover at a time. Supply an ISBN to look up its title, author, link, and available cover automatically. You can also supply these fields manually. The following titles and covers are placeholders for your own selections.

BOOK

Your first book (opens in a new tab)

Author name

Explain which chapter to read and what to look for.

BOOK

Another perspective (opens in a new tab)

Author name

Explain why this alternative might suit the learner.

<Books items={[
  { title: "Book title", author: "Author name", href: "https://example.com/book", cover: "/covers/book.jpg", note: "Read chapter 2, then try the exercise below." }
]} />

Look up a book by ISBN

BOOK

ISBN 9780135957059 (opens in a new tab)

A metadata lookup example. Choose a relevant section before recommending this in a course.

<Books items={[
  { isbn: "9780135957059", note: "Read chapter 1." },
  { isbn: "9781942788003", title: "Your preferred display title" }
]} />

ISBN-10 and ISBN-13 are accepted, including spaces and hyphens. Open Library is queried first, with Google Books as a fallback. Missing covers leave a readable text card. Your explicit values always take priority. Use bun run metadata:refresh to refresh metadata used by the site and rebuild it; a failed refresh keeps the last successful result.

The controls appear only for multiple items. There is no automatic advance. Without JavaScript, all recommendations remain readable.

A LITTLE CLEARER?

Take a moment to explain the idea in your own words.

Progress is saved in this browser.

The Component Workshop

Course overview ↗