Scaffold a starter vanilla web component — a TypeScript source file plus a demo page wired for banira serve.
| Argument | Description |
|---|---|
<tag-name> | Custom element tag name (must contain a hyphen). |
[dir] | Directory to scaffold into. (default: .) |
| Option | Description |
|---|---|
--force | Overwrite existing files instead of leaving them untouched. |
--form-associated | Scaffold a form-associated element (static formAssociated = true + ElementInternals form/validation wiring). |
--aria | Scaffold an ARIA role/state-reflecting element (ElementInternals.role/ariaChecked, keyboard support, @role in the manifest). |
--hydrate | Scaffold a component that hydrates a prerendered Declarative Shadow DOM root (adopt-or-render, no flash). |
$ banira init my-button src$ banira init my-toggle src --ariaThe generated source uses shadow DOM, an observed attribute/property, an event, and the
@slot / @csspart / @cssprop / @fires jsdoc tags that
banira's manifest and doc tooling read. Existing files are left untouched unless --force is given.
The variant flags scaffold a different starter: --form-associated (a <form>-participating
control), --aria (an accessible toggle whose role/state is exposed via ElementInternals), or
--hydrate (a component that adopts its prerendered DSD root on the client). Pass one.