A decorator is a declarative annotation that modifies the behavior of a class, property, method, or getter. In web components, decorators reduce boilerplate while connecting component code to custom elements, attributes, events, public APIs, and reactive updates. section 6.4 section 7.4
Stencil and FAST use decorators to describe how a component participates in the browser platform. A class decorator registers a custom element, property decorators connect properties with HTML attributes, and method decorators configure events or public methods. Options can control reflection, mutability, shadow DOM, styling, and form participation. section 6.4
Common decorator roles include:
- Map a property to an HTML attribute, optionally choosing a kebab-case name, a converter, or a synchronization mode. section 6.4
Reactive properties in FAST
A component can declare @observable n, double, and triple properties. Its nChanged method recalculates double and triple whenever n changes, while bindings display all three values and buttons increment or decrement n. Getters can provide the same derived values; a getter with changing dependencies uses @volatile. section 7.4








