sercrod

Directives overview

Directives are attributes that tell Sercrod what to do. They are written with a special prefix, typically a leading asterisk or event marker, for example *let, *for, *input, or @click.

This page lists the main directives and groups them by purpose. Detailed rules and examples are on the dedicated pages:

Data and interpolation

These directives define or print values inside a host. They work together with the host data object and interpolation markers like %name%.

Conditions and loops

These directives control which elements appear in the DOM and how often they are repeated.

Events and input

These directives connect DOM events and form controls to the host data.

More details and patterns are described in Events and input.

Lifecycle and data roundtrip

Lifecycle helpers save and restore data, or talk to servers. They are designed for small, explicit integrations rather than large client-side frameworks.

For concrete patterns and field mapping rules, see Lifecycle helpers.

Structure and templates

Some directives control how pieces of HTML are inserted, unwrapped, or reused, especially in static site generation or template-heavy setups.

Some of these are mainly used in build pipelines or SSR and may not be needed in small, purely client-side examples.

Summary

At a high level:

When you need precise behavior or edge cases, use the dedicated directive reference pages linked above.