Interactive Components

15 min

Learning Goals

  • Learn about the different components
  • Understand how callouts are used
  • Experiment with tabs and code blocks

Interactive Components

Knowledge Core provides various components for interactive content.

Callouts

Callouts highlight important information:

Information

This is an info callout for general notes.

Success

Shows positive confirmations or completed steps.

Warning

Important warnings that users should note.

Error

Critical information or common errors.

Tabs

Tabs are great for alternative views or multi-platform instructions:

Code Blocks

Syntax-highlighted code with different languages:

JavaScript:

function greet(name) {
  return `Hello, ${name}!`;
}

console.log(greet('World'));

TypeScript:

interface User {
  name: string;
  age: number;
}

const user: User = {
  name: 'Alice',
  age: 30
};

Python:

def greet(name):
    return f"Hello, {name}!"

print(greet("World"))

Exercises

Try it yourself

Easy

Create your own lesson in apps/courses/src/content/lessons/:

  1. Copy this file
  2. Change the frontmatter (title, slug, etc.)
  3. Customize the content
  4. Test with pnpm dev:courses

Hints

Summary

You learned:

  • How callouts represent different information types
  • How tabs show alternative content
  • How code examples are embedded
  • How exercises and hints work

Ready for the next lesson? There you’ll learn about quizzes!