createElement
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" },});API details from source
Section titled “API details from source”
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.
Parameters
Section titled “Parameters”-
type— Pibbl component or fragment to instantiate. See PibblElementType. -
props— Authored props, or null when allowed by the component’s input type. SeeElementInputOrNull. -
children— Child nodes supplied in source order. SeeChildrenArguments.
Returns
Section titled “Returns”A branded Pibbl element descriptor; rendering occurs when it is mounted. See PibblElement .
See also
Section titled “See also”View source — packages/core/src/lib/element/create-element.ts:58
Implementation guidance for agents
Section titled “Implementation guidance for agents”Read the Authoring, signals, and lifecycle companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.
Complete minimal examples
Section titled “Complete minimal examples”- Typed components and recursive children: Build a component with createElement, group its children in a Fragment, and render textual children. Plain source
Documentation version
Section titled “Documentation version”Documentation built with @pibbl/core 0.0.2, revision 272a94a. ALPHA — NOT FOR PRODUCTION USE.