neux - v0.19.0
    Preparing search index...

    Type Alias ElementConfig

    ElementConfig: {
        adoptedStyleSheets?: CSSStyleSheet[];
        attributes?: ReactiveProperty<
            Record<string, ReactiveProperty<unknown>> & ThisType<Node>,
        >;
        children?: ReactiveProperty<NodeConfig | NodeConfigList>;
        classList?: ReactiveProperty<ClassName | ClassName[]>;
        className?: ReactiveProperty<ClassName | ClassName[]>;
        dataset?: ReactiveProperty<
            Record<string, ReactiveProperty<unknown>> & ThisType<Node>,
        >;
        namespaceURI?: string;
        on?: Partial<ElementLifecycle> & Record<
            string,
            (this: Node, event: any) => void,
        >;
        shadowRootMode?: "open" | "closed";
        style?: ReactiveProperty<
            Record<string, ReactiveProperty<unknown>> & ThisType<Node>,
        >;
        tagName?: string;
        use?: string | Element;
    } & Record<string, ReactiveProperty<unknown>> & ThisType<Node>

    Configuration object passed to render or used as a child config.

    Known keys (tagName, className, classList, attributes, dataset, style, children, shadowRootMode, adoptedStyleSheets, namespaceURI, on, use) are handled by the renderer. All other keys are treated as element properties and bound reactively; a function nested inside an object value is assigned as is, not bound.

    Type Declaration

    • OptionaladoptedStyleSheets?: CSSStyleSheet[]

      Style sheets adopted by the shadow root.

    • Optionalattributes?: ReactiveProperty<Record<string, ReactiveProperty<unknown>> & ThisType<Node>>

      Map of HTML attributes to set on the element. Values are converted to strings (false becomes "false"); null or undefined removes the attribute. Set boolean attributes such as disabled as element properties instead.

    • Optionalchildren?: ReactiveProperty<NodeConfig | NodeConfigList>

      Child nodes or config objects rendered inside the element. null, undefined, and booleans are skipped; strings and numbers render as text nodes (0 is a value). An existing Node is inserted as is, unless an equal child is already there: that child is kept instead, and the supplied node is left untouched. A DocumentFragment contributes its child nodes.

    • OptionalclassList?: ReactiveProperty<ClassName | ClassName[]>

      Alias of className; the two share one class list, so set only one of them.

    • OptionalclassName?: ReactiveProperty<ClassName | ClassName[]>

      CSS class name(s) applied to the element. null, undefined, and booleans are skipped; strings and numbers are used as is; entries are split on whitespace.

    • Optionaldataset?: ReactiveProperty<Record<string, ReactiveProperty<unknown>> & ThisType<Node>>

      Map of data-* attributes to set on the element. Keys are camelCase, as in element.dataset (userId sets data-user-id); a kebab-case key such as user-id throws a SyntaxError. null or undefined removes the entry.

    • OptionalnamespaceURI?: string

      Explicit namespace URI; auto-detected for SVG and MathML when omitted.

    • Optionalon?: Partial<ElementLifecycle> & Record<string, (this: Node, event: any) => void>

      Map of event names to handler functions. Includes native DOM events and lifecycle events: mounted, removed, updated.

    • OptionalshadowRootMode?: "open" | "closed"

      Shadow DOM mode for attaching a shadow root to the element. A children diff compares only the light DOM, so elements that differ only in shadow content are interchangeable; give them a distinguishing attribute.

    • Optionalstyle?: ReactiveProperty<Record<string, ReactiveProperty<unknown>> & ThisType<Node>>

      Map of inline CSS styles to apply. Keys are style property names in camelCase (backgroundColor) or kebab-case (background-color); null or undefined clears the property.

    • OptionaltagName?: string

      Tag name.

    • Optionaluse?: string | Element

      A tag string, optionally with id and class selectors (e.g., "div#id1.cls1.cls2"), HTML markup, or an existing element; takes precedence over tagName. Markup yields its first element; markup with no element (such as plain text or a comment) yields an empty div, ignoring tagName. Render a given element only once: rendering it again attaches its event listeners and bindings a second time.