Skip to content

HTML box types

Read as Markdown

Readonly isFocusWithin and isFocusVisible booleans describe the whole native region. Native descendants keep their browser focus and focus rings.

See HtmlBox.

data is the opaque application payload, mount is its mount callback, pointerEvents is "auto" | "none", and optional onFocusChange observes the region snapshot. Read a Pibbl signal with .get() to subscribe the enclosing component when replacing data. data is not recursively resolved.

Pibbl box/layout fields and Group affine transform fields, plus opacity. Width and height default to the parent’s allocation; DOM content does not define intrinsic size. Overflow defaults to clip. Canvas filters enclosing HtmlBox are unsupported.

type HtmlMountCallback<Props> = (
element: HTMLDivElement,
initialProps: Props,
signal: AbortSignal,
) => HtmlUpdateFunction<Props>;

Creates content once in a connected DIV and returns its updater. Use the native AbortSignal for listener and resource cleanup before the DIV is removed.

type HtmlUpdateFunction<Props> = (props: Props) => void;

Updates persistent content after subsequent successful component renders. A clean Layer reprojection does not call the updater. Return a no-op if updates are unused.

Props for a DOM-hosting region, including mount ownership, updates, and focus behavior.

interface HtmlBoxProps<Props>

Related API: HtmlBoxProps.

HtmlMountCallback

HtmlBoxFocusState

HtmlBox

View source — packages/core/src/lib/html/types.ts:51

data
data: Props

Application data supplied to the component or reported by the event. See HtmlBoxProps .

View source — packages/core/src/lib/html/types.ts:56

mount
mount: HtmlMountCallback<Props>

Related API: HtmlMountCallback.

Creates mounted content and its owned lifecycle controls. See HtmlMountCallback.

View source — packages/core/src/lib/html/types.ts:58

pointerEvents (optional)
pointerEvents?: "auto" | "none" | undefined

Whether this content participates in pointer targeting. See HtmlBoxProps.

View source — packages/core/src/lib/html/types.ts:60

onFocusChange (optional)
onFocusChange?: ((state: Readonly<HtmlBoxFocusState>) => void) | undefined

Related API: HtmlBoxFocusState.

Receives changes to focus within the hosted HTML region. See HtmlBoxFocusState.

  • state — Current DOM and Pibbl focus ownership for the HTML region. See HtmlBoxFocusState .

View source — packages/core/src/lib/html/types.ts:66

Layout and presentation of an application-owned HTML region anchored to Canvas geometry.

interface HtmlBoxStyle extends GStyle

Related API: HtmlBoxStyle, GStyle.

GStyle

HtmlBox

View source — packages/core/src/lib/html/types.ts:74

height (optional)
height?: Length | undefined

Related API: Length.

Vertical extent in the units of the containing geometry or surface. See Length.

View source — packages/core/src/lib/style/types.ts:83

minWidth (optional)
minWidth?: number | `${number}%` | undefined

Minimum permitted width. See Length.

View source — packages/core/src/lib/style/types.ts:85

opacity (optional)
opacity?: number | undefined

Related API: opacity.

Opacity of the painted result. See HtmlBoxStyle.

View source — packages/core/src/lib/html/types.ts:76

transition (optional)
transition?: PibblTransitionBinding | undefined

Related API: PibblTransitionBinding.

Visibility-transition binding applied to this primitive and its captured descendants. See SystemStyle.

View source — packages/core/src/lib/types.ts:69

left (optional)
left?: number | `${number}%` | undefined

Left edge coordinate or inset. See Length.

View source — packages/core/src/lib/style/positioning.ts:127

top (optional)
top?: number | `${number}%` | undefined

Top edge value or top envelope guide. See Length.

View source — packages/core/src/lib/style/positioning.ts:129

width (optional)
width?: Length | undefined

Related API: Length.

Horizontal extent in the units of the containing geometry or surface. See Length.

View source — packages/core/src/lib/style/types.ts:81

maxWidth (optional)
maxWidth?: number | `${number}%` | undefined

Maximum permitted width. See Length.

View source — packages/core/src/lib/style/types.ts:87

minHeight (optional)
minHeight?: number | `${number}%` | undefined

Minimum permitted height. See Length.

View source — packages/core/src/lib/style/types.ts:89

maxHeight (optional)
maxHeight?: number | `${number}%` | undefined

Maximum permitted height. See Length.

View source — packages/core/src/lib/style/types.ts:91

padding (optional)
padding?: EdgeValues | undefined

Related API: EdgeValues.

Insets between the border box and content box. See EdgeValues.

View source — packages/core/src/lib/style/types.ts:93

overflow (optional)
overflow?: "clip" | "visible" | undefined

Selects "visible", "clip" for overflow. See BoxStyle.

View source — packages/core/src/lib/style/types.ts:95

alignSelf (optional)
alignSelf?: "auto" | "center" | "end" | "flex-end" | "flex-start" | "start" | "stretch" | undefined

This child’s cross-axis or block-axis alignment override. See LayoutItemStyle.

View source — packages/core/src/lib/style/types.ts:121

justifySelf (optional)
justifySelf?: "auto" | "center" | "end" | "start" | "stretch" | undefined

This child’s inline-axis alignment override. See LayoutItemStyle.

View source — packages/core/src/lib/style/types.ts:123

flexBasis (optional)
flexBasis?: Length | undefined

Related API: Length.

Initial main-axis size before flex growth or shrinkage. See Length.

View source — packages/core/src/lib/style/types.ts:125

flexGrow (optional)
flexGrow?: number | undefined

Relative share of positive free space assigned to this child. See LayoutItemStyle.

View source — packages/core/src/lib/style/types.ts:127

flexShrink (optional)
flexShrink?: number | undefined

Relative factor used when reducing main-axis size. See LayoutItemStyle.

View source — packages/core/src/lib/style/types.ts:129

gridColumnStart (optional)
gridColumnStart?: number | undefined

Explicit starting grid column. See LayoutItemStyle.

View source — packages/core/src/lib/style/types.ts:131

gridColumnSpan (optional)
gridColumnSpan?: number | undefined

Number of columns occupied by this child. See LayoutItemStyle.

View source — packages/core/src/lib/style/types.ts:133

gridRowStart (optional)
gridRowStart?: number | undefined

Explicit starting grid row. See LayoutItemStyle.

View source — packages/core/src/lib/style/types.ts:135

gridRowSpan (optional)
gridRowSpan?: number | undefined

Number of rows occupied by this child. See LayoutItemStyle.

View source — packages/core/src/lib/style/types.ts:137

scaleX (optional)
scaleX?: number | undefined

Horizontal scale factor. See GStyle.

View source — packages/core/src/lib/components/g.ts:45

scaleY (optional)
scaleY?: number | undefined

Vertical scale factor. See GStyle.

View source — packages/core/src/lib/components/g.ts:47

rotationDegrees (optional)
rotationDegrees?: number | undefined

Clockwise rotation in degrees.

View source — packages/core/src/lib/components/g.ts:49

rotationOrigin (optional)
rotationOrigin?: [number, number] | undefined

Point around which the rotation is applied. See GStyle.

View source — packages/core/src/lib/components/g.ts:51

translateX (optional)
translateX?: number | undefined

Horizontal translation in the current logical coordinate system. See GStyle.

View source — packages/core/src/lib/components/g.ts:53

translateY (optional)
translateY?: number | undefined

Vertical translation in the current logical coordinate system. See GStyle.

View source — packages/core/src/lib/components/g.ts:55

skewX (optional)
skewX?: number | undefined

Horizontal skew angle in degrees.

View source — packages/core/src/lib/components/g.ts:57

skewY (optional)
skewY?: number | undefined

Vertical skew angle in degrees.

View source — packages/core/src/lib/components/g.ts:59

custom (optional)
custom?: unknown

Application-defined style payload passed through the runtime. See SystemStyle.

View source — packages/core/src/lib/types.ts:71

filter (optional)
filter?: PibblFilter | readonly PibblFilter[] | undefined

Related API: PibblFilter.

Ordered pixel-only filters applied to the receiving primitive and its descendants. See PibblFilter.

View source — packages/core/src/lib/types.ts:76

Mounts application HTML into the supplied host and returns its prop-update callback; the abort signal marks teardown.

type HtmlMountCallback<Props> = (element: HTMLDivElement, initialProps: Props, signal: AbortSignal) => HtmlUpdateFunction<Props>

Related API: HtmlMountCallback, signal, HtmlUpdateFunction.

  • element — Pibbl-owned host div into which application content may be mounted.

  • initialProps — Props from the initial mount.

  • signal — Lifetime signal aborted when the host is disposed.

An update callback for subsequent props; release application resources when the signal aborts. See HtmlUpdateFunction .

HtmlUpdateFunction

HtmlBoxProps

HtmlBox

View source — packages/core/src/lib/html/types.ts:29

Updates mounted application HTML when the owning HtmlBox receives new props.

type HtmlUpdateFunction<Props> = (props: Props) => void

Related API: HtmlUpdateFunction.

  • props — Latest props for the mounted HTML content.

HtmlMountCallback

View source — packages/core/src/lib/html/types.ts:14

Focus state shared between an HTML host and Pibbl’s logical focus management.

interface HtmlBoxFocusState

Related API: HtmlBoxFocusState.

HtmlBoxProps

View source — packages/core/src/lib/html/types.ts:35

isFocusWithin
readonly isFocusWithin: boolean

Whether an element inside the hosted HTML region currently has focus. See HtmlBoxFocusState.

View source — packages/core/src/lib/html/types.ts:40

isFocusVisible
readonly isFocusVisible: boolean

Whether focus should be presented as keyboard-visible. See HtmlBoxFocusState.

View source — packages/core/src/lib/html/types.ts:42

Read the Input, focus, and native HTML 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.