Authoring components

banira reads ordinary class members and a handful of jsdoc tags — no decorators, no base class.

Read straight from the code

Most of the manifest comes from the platform itself, with no annotation required:

The jsdoc tags

Slots, CSS parts and CSS custom properties aren't visible from the runtime shape, so banira reads them from class jsdoc tags:

TagDescribes
@slotA named (or default) slot the component projects into.
@csspartA ::part() exposed for external styling.
@csspropA CSS custom property the component reads.
@firesAn event the component dispatches.

A worked example

src/my-button.ts
/**
 * @element my-button
 * @csspart button - the inner button element
 * @cssprop --my-button-radius - corner radius
 * @fires click - when the button is activated
 */
export class MyButton extends HTMLElement {
  static observedAttributes = ['variant', 'size'];
  /* … */
}
customElements.define('my-button', MyButton);

Deprecation & visibility

Members marked @deprecated carry their note through into the manifest and the generated docs. Members marked @internal or @ignore are omitted entirely — handy for keeping implementation details out of the public API surface.

Tip. Run banira manifest --validate to check the generated manifest against the CEM 2.1.0 shape, and banira doc to eyeball how the tags render in a real reference page.