Widget Showcase: Interactive Components for AI Education
This post demonstrates every interactive widget available in MDX content. Each widget is used directly — no import statements needed.
CodeEditor
A syntax-highlighted code editor powered by CodeMirror 6.
async function askClaude(prompt) {
const response = await fetch('/api/proxy/anthropic', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ prompt }),
});
return response.json();
}CodePlayground
A live code editor with preview pane, powered by Sandpack.
APIPlayground
A BYOK (bring your own key) playground for live LLM API calls.
TokenVisualizer
Breaks text into color-coded tokens using tiktoken in the browser.
Diagram
Renders Mermaid diagrams as interactive SVGs.
AnimatedExplainer
Step-through animated visualizations for complex concepts.
Input
The user's text is tokenized into a sequence of integers.
Quiz
Multiple-choice questions with instant feedback.
What does the 'temperature' parameter control in an LLM?
SlideDeck
Embedded presentations with keyboard navigation.
Self-Attention
The mechanism behind modern AI
The Key Idea
Instead of processing words sequentially, attention lets the model look at all words simultaneously and decide which ones are relevant to each other.
The Formula
Attention(Q, K, V) = softmax(QKᵀ / √dₖ) · V“Attention is all you need.”
— Vaswani et al., 2017
The paper that started the transformer revolution
ScrollWalkthrough
A scroll-driven code walkthrough with synchronized panels.
Define the tool
First, describe the tool the model can call. Each tool needs a name, description, and input schema.
const tools = [{
name: "get_weather",
description: "Get current weather for a city",
input_schema: {
type: "object",
properties: {
city: { type: "string" }
},
required: ["city"]
}
}];Send the message
Pass the tools array alongside the user's message. The model decides whether to call a tool or respond directly.
Handle tool use
Check the stop_reason. If it's 'tool_use', execute the tool and send the result back.
GSAPTimeline
Animated stage with GSAP-driven timeline playback.
InteractiveTimeline
A vertical timeline of events with scroll or interactive modes.
Word2Vec
Mikolov introduces word embeddings that capture semantic relationships.
Seq2Seq
Sutskever et al. introduce encoder-decoder architecture for machine translation.
Attention Mechanism
Bahdanau et al. add attention to seq2seq models, dramatically improving translation.
Transformer
Vaswani et al. publish 'Attention Is All You Need' — attention without recurrence.
GPT & BERT
Pre-trained transformers achieve state-of-the-art on virtually every NLP benchmark.
MediaPlayer
A styled audio/video player with playback controls.
MotionCanvasPlayer
A player for Motion Canvas animations (requires a compiled animation source).
RichTooltip
Inline tooltips with rich content — hover to reveal.
Try hovering over this
Alternatives
Tabbed comparison panels for showing multiple approaches.
npm install @anthropic-ai/sdkTweetEmbed
Self-contained post cards with no external scripts or tracking.
We're excited to introduce Claude — an AI assistant that's helpful, harmless, and honest.
Chart
Animated charts using visx + GSAP with Drawn Wire styling.