Skip to content

Layout types

Read as Markdown

Pibbl layout is opt-in and immediate-mode. Parents inspect normalized direct-child styles, resolve finite allocations, and render one child descriptor at a time; they do not retain drawing commands. Style is local and never cascades.

AbsoluteStyle is the declared container style for Absolute, including its finite box and the independent left/top placement vocabulary for children.

BoxStyle is the shared declared-box vocabulary: dimensions, min/max limits, padding, and the local inputs needed to resolve a finite box.

CanvasMeasurementService supplies the caller-owned Canvas measurement operation used by pure measureElement; it cannot render or acquire runtime resources.

Constraints defines finite minimum and maximum width/height limits for layout resolution and pure measurement.

Edges is the normalized finite top/right/bottom/left edge record.

EdgeValues is the public shorthand accepted for edge values. A scalar applies to all sides and omitted sides resolve to zero.

FlexItemStyle is the direct-child participation style consumed by a Flex parent; it does not create a CSS cascade.

FlexProps accepts recursive PibblNode children for Pibbl’s supported Flexbox subset.

FlexStyle is the declared container style for Flex. Reverse/reordered flexing, advanced intrinsic sizing, margins, and scrolling are unsupported.

FlowProps accepts recursive PibblNode children for sequential flow layout.

FlowStyle configures the direction, wrapping, and declared box for Flow.

GridItemStyle is the direct-child placement style consumed by an explicit Grid parent.

GridProps accepts recursive PibblNode children for explicit-track grid layout.

GridStyle configures the declared box and explicit tracks for Grid; CSS auto-placement and advanced intrinsic sizing are not supported.

GridTrack describes one explicit Grid track in Pibbl’s supported subset.

LayoutBox is the stable readonly child-local allocation available during render through useLayoutBox.

LayoutDiagnosticContext carries component and algorithm context for a public layout/style validation failure.

LayoutDiagnosticInput is the structured public input accepted by layoutDiagnostic to identify property, supplied value, and optional constraints.

LayoutItemStyle is the shared direct-child participation vocabulary for Absolute, Overlay, Flex, and Grid parents.

Length is Pibbl’s public numeric/percentage/"auto" length vocabulary. Resolution requires a definite percentage basis when a percentage is used.

MeasureInput describes an opt-in primitive’s pure measurement request.

MeasureResult is the result of measureElement and distinguishes supported measurement from an unsupported primitive capability.

OverlayStyle is the declared shared-allocation style for Overlay children.

Percentage is the public percentage-length form. It resolves only against a definite nonnegative reference dimension.

ResolvedBoxStyle is the finite box result with its resolved border/content geometry after box-style validation.

Size is the finite width/height record used by layout and measurement.

Supported geometry and presentation properties for Absolute.

type AbsoluteStyle = BoxStyle & LayoutItemStyle

Related API: AbsoluteStyle, BoxStyle, LayoutItemStyle.

BoxStyle

LayoutItemStyle

Absolute

View source — packages/core/src/lib/layout/absolute.ts:55

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

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

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

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

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

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

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

Supported geometry and presentation properties for Overlay.

interface OverlayStyle extends BoxStyle, LayoutItemStyle

Related API: OverlayStyle, BoxStyle, LayoutItemStyle.

BoxStyle

LayoutItemStyle

Overlay

View source — packages/core/src/lib/layout/overlay.ts:38

alignItems (optional)
alignItems?: OverlayAlignment | undefined

Default alignment of children on the cross or block axis. See OverlayAlignment.

View source — packages/core/src/lib/layout/overlay.ts:40

justifyItems (optional)
justifyItems?: OverlayAlignment | undefined

Default inline-axis alignment of grid or overlay children. See OverlayAlignment.

View source — packages/core/src/lib/layout/overlay.ts:42

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

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

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

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

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

Authored inputs for Flow, including the declared data and presentation options.

interface FlowProps extends PibblStructuralEventProps

Related API: FlowProps.

PibblNodeInput

Flow

View source — packages/core/src/lib/layout/flow.ts:67

children
children: PibblNodeInput

Related API: PibblNodeInput.

Descendant content or the callback that supplies it. See PibblNodeInput.

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

Supported geometry and presentation properties for Flow.

interface FlowStyle extends BoxStyle, LayoutItemStyle

Related API: FlowStyle, BoxStyle, LayoutItemStyle.

BoxStyle

LayoutItemStyle

Flow

View source — packages/core/src/lib/layout/flow.ts:48

direction (optional)
direction?: FlowDirection | undefined

Direction in which this operation proceeds. See FlowDirection.

View source — packages/core/src/lib/layout/flow.ts:50

wrap (optional)
wrap?: boolean | undefined

Whether content may wrap into additional lines. See FlowStyle.

View source — packages/core/src/lib/layout/flow.ts:52

gap (optional)
gap?: number | undefined

Spacing between adjacent items. See FlowStyle.

View source — packages/core/src/lib/layout/flow.ts:54

lineGap (optional)
lineGap?: number | undefined

Space between wrapped flow lines. See FlowStyle.

View source — packages/core/src/lib/layout/flow.ts:56

alignItems (optional)
alignItems?: FlowAlignment | undefined

Default alignment of children on the cross or block axis. See FlowAlignment.

View source — packages/core/src/lib/layout/flow.ts:58

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

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

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

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

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

Authored inputs for Flex, including the declared data and presentation options.

interface FlexProps extends PibblStructuralEventProps

Related API: FlexProps.

PibblNodeInput

Flex

View source — packages/core/src/lib/layout/flex.ts:89

children
children: PibblNodeInput

Related API: PibblNodeInput.

Descendant content or the callback that supplies it. See PibblNodeInput.

View source — packages/core/src/lib/layout/flex.ts:91

Supported geometry and presentation properties for Flex.

interface FlexStyle extends BoxStyle, LayoutItemStyle

Related API: FlexStyle, BoxStyle, LayoutItemStyle.

BoxStyle

LayoutItemStyle

Flex

View source — packages/core/src/lib/layout/flex.ts:61

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

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

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

flexDirection (optional)
flexDirection?: FlexDirection | undefined

The main axis along which flex children are placed. See FlexDirection.

View source — packages/core/src/lib/layout/flex.ts:63

flexWrap (optional)
flexWrap?: FlexWrap | undefined

Whether children may wrap onto additional flex lines. See FlexWrap.

View source — packages/core/src/lib/layout/flex.ts:65

justifyContent (optional)
justifyContent?: MainAlignment | undefined

Distribution of children along the main axis. See MainAlignment.

View source — packages/core/src/lib/layout/flex.ts:67

alignItems (optional)
alignItems?: CrossAlignment | undefined

Default alignment of children on the cross or block axis. See CrossAlignment.

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

alignContent (optional)
alignContent?: "center" | "flex-end" | "flex-start" | "space-around" | "space-between" | "space-evenly" | "stretch" | undefined

Distribution of wrapped flex lines within the available cross-axis space. See CrossAlignment, MainAlignment.

View source — packages/core/src/lib/layout/flex.ts:74

gap (optional)
gap?: number | undefined

Spacing between adjacent items. See FlexStyle.

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

rowGap (optional)
rowGap?: number | undefined

Space between adjacent rows or items on the row axis. See FlexStyle.

View source — packages/core/src/lib/layout/flex.ts:78

columnGap (optional)
columnGap?: number | undefined

Space between adjacent columns or items on the column axis. See FlexStyle.

View source — packages/core/src/lib/layout/flex.ts:80

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

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

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

Authored inputs for Grid, including the declared data and presentation options.

interface GridProps extends PibblStructuralEventProps

Related API: GridProps.

PibblNodeInput

Grid

View source — packages/core/src/lib/layout/grid.ts:87

children
children: PibblNodeInput

Related API: PibblNodeInput.

Descendant content or the callback that supplies it. See PibblNodeInput.

View source — packages/core/src/lib/layout/grid.ts:89

Supported geometry and presentation properties for Grid.

interface GridStyle extends BoxStyle, LayoutItemStyle

Related API: GridStyle, BoxStyle, LayoutItemStyle.

BoxStyle

LayoutItemStyle

GridTrack

Grid

View source — packages/core/src/lib/layout/grid.ts:64

gridTemplateColumns
gridTemplateColumns: readonly GridTrack[]

Related API: GridTrack.

Explicit grid column track definitions. See GridTrack.

View source — packages/core/src/lib/layout/grid.ts:66

gridTemplateRows
gridTemplateRows: readonly GridTrack[]

Related API: GridTrack.

Explicit grid row track definitions. See GridTrack.

View source — packages/core/src/lib/layout/grid.ts:68

justifyItems (optional)
justifyItems?: GridAlignment | undefined

Default inline-axis alignment of grid or overlay children. See GridAlignment.

View source — packages/core/src/lib/layout/grid.ts:70

alignItems (optional)
alignItems?: GridAlignment | undefined

Default alignment of children on the cross or block axis. See GridAlignment.

View source — packages/core/src/lib/layout/grid.ts:72

gap (optional)
gap?: number | undefined

Spacing between adjacent items. See GridStyle.

View source — packages/core/src/lib/layout/grid.ts:74

rowGap (optional)
rowGap?: number | undefined

Space between adjacent rows or items on the row axis. See GridStyle.

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

columnGap (optional)
columnGap?: number | undefined

Space between adjacent columns or items on the column axis. See GridStyle.

View source — packages/core/src/lib/layout/grid.ts:78

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

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

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

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

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

A fixed logical size, percentage of available space, or fractional share of remaining grid space.

type GridTrack = number | `${number}%` | `${number}fr`

Related API: GridTrack.

GridStyle

View source — packages/core/src/lib/layout/grid.ts:49

Declared box dimensions, size limits, padding, and overflow behavior.

interface BoxStyle extends SystemStyle

Related API: BoxStyle, SystemStyle.

SystemStyle

Length

EdgeValues

ImgStyle

PathStyle

RectStyle

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

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

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

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

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

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

One inset for every edge or independently specified top, right, bottom, and left insets.

type EdgeValues = | number
| Readonly<{
/** Top edge value or top envelope guide. See {@link EdgeValues}. */
top?: number;
/** Right edge coordinate or inset. See {@link EdgeValues}. */
right?: number;
/** Bottom edge value or bottom envelope guide. See {@link EdgeValues}. */
bottom?: number;
/** Left edge coordinate or inset. See {@link EdgeValues}. */
left?: number;
}>

Related API: EdgeValues.

BoxStyle

normalizeEdges

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

The supported flex sizing and cross-axis alignment properties of a child.

type FlexItemStyle = Pick<
LayoutItemStyle,
'flexBasis' | 'flexGrow' | 'flexShrink'
> & {
/** This child's cross-axis or block-axis alignment override. See {@link FlexItemStyle}. */
alignSelf?: 'auto' | 'stretch' | 'flex-start' | 'flex-end' | 'center';
}

Related API: FlexItemStyle, LayoutItemStyle.

LayoutItemStyle

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

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

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

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

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

Explicit grid cell placement, spans, and alignment of a child.

interface GridItemStyle extends SystemStyle

Related API: GridItemStyle, SystemStyle.

SystemStyle

GridStyle

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

gridColumnStart (optional)
gridColumnStart?: number | undefined

Explicit starting grid column. See GridItemStyle.

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

gridColumnSpan (optional)
gridColumnSpan?: number | undefined

Number of columns occupied by this child. See GridItemStyle.

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

gridRowStart (optional)
gridRowStart?: number | undefined

Explicit starting grid row. See GridItemStyle.

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

gridRowSpan (optional)
gridRowSpan?: number | undefined

Number of rows occupied by this child. See GridItemStyle.

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

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

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

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

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

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

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

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

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

Parent-layout participation: positioning, self-alignment, flex sizing, and explicit grid placement.

interface LayoutItemStyle extends PositioningStyle

Related API: LayoutItemStyle.

Length

FlexItemStyle

ImgStyle

PathStyle

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

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

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

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

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

A layout length in logical units, a parent-relative percentage, or automatic sizing.

type Length = number | Percentage | 'auto'

Related API: Length, Percentage.

Percentage

BoxStyle

LayoutItemStyle

RectStyle

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

Resolved border and content boxes after sizing and padding are applied.

interface ResolvedBoxStyle

Related API: ResolvedBoxStyle.

LayoutBox

resolveBox

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

borderBox
borderBox: LayoutBox

Related API: LayoutBox.

The resolved outer rectangle including padding. See LayoutBox.

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

contentBox
contentBox: LayoutBox

Related API: LayoutBox.

The resolved rectangle available to content after padding. See LayoutBox.

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

A percentage string resolved against the relevant parent layout dimension.

type Percentage = `${number}%`

Related API: Percentage.

Length

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

Component and source context attached to a layout diagnostic.

interface LayoutDiagnosticContext

Related API: LayoutDiagnosticContext.

Constraints

LayoutDiagnosticInput

normalizeEdges

resolveLength

View source — packages/core/src/lib/style/diagnostics.ts:13

component (optional)
component?: string | undefined

Component identity or diagnostic name associated with this value. See LayoutDiagnosticContext.

View source — packages/core/src/lib/style/diagnostics.ts:18

algorithm (optional)
algorithm?: string | undefined

Name of the layout algorithm producing this diagnostic or resolution. See LayoutDiagnosticContext.

View source — packages/core/src/lib/style/diagnostics.ts:23

constraints (optional)
constraints?: Readonly<Constraints> | undefined

Related API: Constraints.

Sizing limits and available dimensions for this operation. See Constraints.

View source — packages/core/src/lib/style/diagnostics.ts:25

Validation-failure details used to construct a layout diagnostic.

interface LayoutDiagnosticInput extends LayoutDiagnosticContext

Related API: LayoutDiagnosticInput, LayoutDiagnosticContext.

LayoutDiagnosticContext

layoutDiagnostic

View source — packages/core/src/lib/style/diagnostics.ts:34

property
property: string

Name of the affected input property. See LayoutDiagnosticInput.

View source — packages/core/src/lib/style/diagnostics.ts:36

value
value: unknown

Value associated with this sample, input, or result. See LayoutDiagnosticInput.

View source — packages/core/src/lib/style/diagnostics.ts:38

reason
reason: string

Reason the operation could not produce its ordinary result. See LayoutDiagnosticInput .

View source — packages/core/src/lib/style/diagnostics.ts:43

component (optional)
component?: string | undefined

Component identity or diagnostic name associated with this value. See LayoutDiagnosticContext.

View source — packages/core/src/lib/style/diagnostics.ts:18

algorithm (optional)
algorithm?: string | undefined

Name of the layout algorithm producing this diagnostic or resolution. See LayoutDiagnosticContext.

View source — packages/core/src/lib/style/diagnostics.ts:23

constraints (optional)
constraints?: Readonly<Constraints> | undefined

Related API: Constraints.

Sizing limits and available dimensions for this operation. See Constraints.

View source — packages/core/src/lib/style/diagnostics.ts:25

Available and limiting dimensions supplied to layout and measurement.

interface Constraints

Related API: Constraints.

measureElement

resolveBox

LayoutDiagnosticContext

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

minWidth
minWidth: number

Minimum permitted width. See Constraints.

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

maxWidth
maxWidth: number

Maximum permitted width. See Constraints.

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

minHeight
minHeight: number

Minimum permitted height. See Constraints.

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

maxHeight
maxHeight: number

Maximum permitted height. See Constraints.

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

Resolved numeric insets for the four sides of a box.

interface Edges

Related API: Edges.

normalizeEdges

BoxStyle

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

top
top: number

Top edge value or top envelope guide. See Edges.

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

right
right: number

Right edge coordinate or inset. See Edges.

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

bottom
bottom: number

Bottom edge value or bottom envelope guide. See Edges.

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

left
left: number

Left edge coordinate or inset. See Edges.

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

An axis-aligned rectangle in the layout coordinate system.

interface LayoutBox extends Size

Related API: LayoutBox, Size.

Size

PibblRenderLayerTarget

ResolvedBoxStyle

useLayoutBox

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

x
x: number

Horizontal coordinate or displacement in the containing coordinate system. See LayoutBox.

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

y
y: number

Vertical coordinate or displacement in the containing coordinate system. See LayoutBox .

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

width
width: number

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

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

height
height: number

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

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

Width and height in logical Canvas units.

interface Size

Related API: Size.

LayoutBox

MeasureResult

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

width
width: number

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

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

height
height: number

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

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

Canvas text measurement services supplied to pure layout measurement.

interface CanvasMeasurementService

Related API: CanvasMeasurementService.

MeasureInput

measureElement

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

measureText
measureText: (text: string, font: string) => TextMetrics

Measures text using the requested Canvas font configuration. See CanvasMeasurementService.

  • text — Text to measure.

  • font — Canvas font string used for measurement.

Canvas text metrics for the supplied text and font.

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

Declared style, props, and constraints passed to a primitive’s measurement callback.

interface MeasureInput<P, S extends SystemStyle = SystemStyle>

Related API: MeasureInput, SystemStyle.

SystemStyle

NormalizedStyle

Constraints

CanvasMeasurementService

PibblElement

MeasureResult

PrimitiveCapabilities

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

props
props: Readonly<P>

Component props supplied to evaluation or measurement. See MeasureInput.

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

style
style: Readonly<S>

Declared presentation and layout properties. See NormalizedStyle.

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

constraints
constraints: Readonly<Constraints>

Related API: Constraints.

Sizing limits and available dimensions for this operation. See Constraints.

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

service
service: CanvasMeasurementService

Related API: CanvasMeasurementService.

Measurement services available while evaluating this input. See CanvasMeasurementService.

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

measureElement
measureElement: (element: PibblElement<any>, constraints: Readonly<Constraints>) => MeasureResult

Related API: measureElement, PibblElement, Constraints, MeasureResult.

Measures a nested element using the current measurement context. See MeasureResult.

  • element — Child element to measure. See PibblElement.

  • constraints — Available dimensions in logical units. See Constraints.

Measured dimensions or an unsupported measurement result. See MeasureResult.

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

Measured dimensions, or an explicit unsupported result with a diagnostic reason.

type MeasureResult = | {
/** The literal "measured" identifying this variant. See {@link MeasureResult}. */
status: "measured";
/** Measured logical width and height. See {@link Size}. */
size: Readonly<Size>;
}
| {
/** The literal "unsupported" identifying this variant. See {@link MeasureResult}. */
status: "unsupported";
/** Reason the operation could not produce its ordinary result. See {@link MeasureResult}. */
reason: string;
}

Related API: MeasureResult, Size.

Size

PrimitiveCapabilities

MeasureInput

measureElement

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

status
status: "measured" | "unsupported"

The literal “measured” identifying this variant. See MeasureResult. The literal “unsupported” identifying this variant. See MeasureResult.

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

Read the Drawing, layout, and effects 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.