Component basics
Components are the building blocks of Aurelia applications. This guide covers creating, configuring, and using components effectively.
Creating Your First Component
export class UserCard {
name = 'John Doe';
email = 'john@example.com';
}<div class="user-card">
<h3>${name}</h3>
<p>${email}</p>
</div>Component Configuration
import { customElement } from 'aurelia';
@customElement({
name: 'user-card',
template: `
<div class="user-card">
<h3>\${name}</h3>
<p>\${email}</p>
</div>
`
})
export class UserCard {
name = 'John Doe';
email = 'john@example.com';
}Configuration Options
Importing external HTML templates with bundlers
Alternative Creation Methods
HTML-Only Components
Viewless Components
Using Components
Containerless Components
Component Lifecycle
Bindable Properties
Advanced Features
Shadow DOM
Template Processing
Enhancing Existing DOM
Reactive Properties
Child Element Observation
Component Configuration
Best Practices
Component Design
Performance
Testing
Last updated
Was this helpful?