Skip to content

createElement

Read as Markdown

import { createElement, Rectangle } from "@pibbl/core";

createElement(type, props, ...children) constructs the branded PibblElement explicit equivalent of Pibbl JSX. Its type is a PibblElementType; props can be null; variadic PibblNode children override props.children, while zero variadic children preserve it. key accepts a PibblKey, is normalized, and is not delivered to props.

const scene = createElement(Rectangle, {
style: { width: 160, height: 80, fill: "#2563eb" },
});

Try Authoring without JSX.

Public constructor used by direct element authoring.

createElement: <P>(type: PibblElementType<P>, props: ElementInputOrNull<P>, ...children: ChildrenArguments<P>) => PibblElement<P>

Related API: createElement, PibblElementType, PibblElement.

  • type — Pibbl component or fragment to instantiate. See PibblElementType.

  • props — Authored props, or null when allowed by the component’s input type. See ElementInputOrNull .

  • children — Child nodes supplied in source order. See ChildrenArguments.

A branded Pibbl element descriptor; rendering occurs when it is mounted. See PibblElement .

PibblElementType

PibblElement

View source — packages/core/src/lib/element/create-element.ts:58

Read the Authoring, signals, and lifecycle companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.

Documentation built with @pibbl/core 0.0.2, revision 2dccb19. ALPHA — NOT FOR PRODUCTION USE.