Namespace: UIComponent

UIComponent

The interface of a BlazeUI component that is
related to a Blaze Template with the same name.

You will not instantiate this at any time, however
BlazeUI will call its constructur, to ensure
the interface using check/match as its underlying implementation.

Your component can, of course, contain any attitional properties
that are not defined in this interface.

Properties:
Name Type Attributes Description
name string

the name of the Template, must be strictly equal to the Template's name

class string

the (static) base classes of the component

main boolean <optional>

if set to true, this component is considered a root component in higher order
components and usually has no own style or attributes but may provide context and logic.
This is a conventional flag and is not required at all.

state function <optional>

optional state factory

attributes object | function <optional>

Define which attributes are to be added to the DOM element
that called {{blazeui_atts}}

  • If you provide an object, you can define default attributes that always have to exist,
    for example role="button" or type="submit". Can be overridden at runtime.
  • If you provide a function you can precisely control how attributes are resolved and attached to the component.
    Leave undefined if no variants and no default attributes are used.
variants object | function <optional>

a dictionary for variants and their respective values.
see the npm package class-variance-authority for what this is and how this works.

defaultVariants object <optional>

a dictionary to defined default values for the given variants

onCrated function <optional>

optional Blaze Template lifecycle method

onRendered function <optional>

optional Blaze Template lifecycle method

onDestroyed function <optional>

optional Blaze Template lifecycle method

helpers object | function <optional>

optional Blaze Template lifecycle method argument

events object | function <optional>

optional Blaze Template lifecycle method argument

Source:
See: