Example: Code Group and Alerts
This page demonstrates tabbed code blocks and alert containers.
When to use
- Use
code-group when you need to show one feature across multiple files.
- Use alerts to emphasize warnings, tips, and important constraints.
- Combine both patterns to create tutorial-style pages.
Code Group syntax
Code Group demo
Alert syntax
Alerts demo
Tip
Use code-group when you need to show the same logic in multiple files.
Info
Alerts are rendered as dedicated styled containers in markdown output.
Warning
Keep code snippets short to improve readability in docs.
Success
You can combine alerts, code groups and component previews on one page.
Preview Group demo
Introduction
Writing
Examples
Validation steps
- Confirm code tabs are visible and switchable.
- Confirm each alert type has distinct styling.
- Confirm preview cards are rendered in
preview-group.
Common mistakes
- Missing tab labels in
code-group blocks.
- Putting very large code samples in one tab set.
- Overusing alerts so important messages lose contrast.