Recipes Overview
Practical component recipes for building common UI elements in Aurelia
This section contains practical, real-world examples of building reusable UI components in Aurelia. Each recipe shows you how to create a complete, production-ready component from scratch.
What You'll Find Here
These recipes demonstrate:
Best practices for component architecture
Accessibility considerations
TypeScript with proper typing
Testing patterns for each component
Real-world features and edge cases
Available Recipes
UI Components
Dropdown Menu: A fully-featured dropdown with keyboard navigation and accessibility
Modal Dialog: A flexible modal system with backdrop, animations, and focus management
Tabs Component: An accessible tab interface with dynamic content
Tooltip: Position-aware tooltips with smart placement
Accordion: Collapsible content panels with smooth animations
How to Use These Recipes
Each recipe includes:
Overview: What the component does and when to use it
Complete Code: TypeScript and HTML for the component
Usage Examples: How to consume the component
Styling: Base CSS to get you started
Testing: How to test the component
Enhancements: Ideas for extending the component
Prerequisites
These recipes assume you're familiar with:
Code Standards
All recipes follow Aurelia 2 best practices:
Use
resolve()for dependency injection (not decorators)No
<template>wrappers in HTML filesNamed exports for reusable components
Proper cleanup in
detaching()lifecycle hooksAccessible markup with ARIA attributes
Contributing
Have a component recipe you'd like to share? Contributions are welcome! Make sure your recipe includes:
Complete, working code
Accessibility considerations
Usage examples
Tests
Clear explanations
Ready to build something? Pick a recipe and start coding!
Last updated
Was this helpful?