Grid track definitions
import { minmax, repeatTracks, autoFillTracks, autoFitTracks,} from "@pibbl/core";
const bounded = minmax({ min: 40, max: "1fr" });const repeated = repeatTracks([bounded], { count: 3 });const filled = autoFillTracks(80);const fitted = autoFitTracks(80);Each constructor returns an immutable track definition. minmax names the
minimum and maximum breadth; repeatTracks repeats its input list a positive
integer number of times. autoFillTracks fits repetitions into the available
finite axis. autoFitTracks also collapses repetitions that have no participating
items. These definitions are consumed by the experimental native Grid engine.
Intrinsic tracks demand declared pure intrinsic measurements. Opaque component programs are never evaluated to infer a contribution. Invalid, cyclic or unresolvable definitions fail with a contextual layout diagnostic.
These definitions use GridTrack,
GridTrackBreadth,
GridMinMaxTrack,
GridRepeatTrack, and
GridStyle.
API details from source
Section titled “API details from source”
minmax
Section titled “minmax”Creates an immutable bounded Grid track.
minmax: (options: Readonly<{ min: GridTrackBreadth; max: GridTrackBreadth; }>) => GridMinMaxTrackRelated API: minmax, GridTrackBreadth, GridMinMaxTrack.
Parameters
Section titled “Parameters”options— The minimum and maximum breadths.
Returns
Section titled “Returns”An immutable minmax track definition.
See also
Section titled “See also”View source — packages/core/src/lib/layout/grid.ts:91
repeatTracks
Section titled “repeatTracks”Repeats Grid tracks a fixed number of times.
repeatTracks: (tracks: readonly GridTrack[], options: Readonly<{ count: number; }>) => GridRepeatTrackRelated API: repeatTracks, GridTrack, GridRepeatTrack.
Parameters
Section titled “Parameters”-
tracks— The track sequence to repeat. -
options— The repeat count.
Returns
Section titled “Returns”An immutable repeated track definition.
See also
Section titled “See also”View source — packages/core/src/lib/layout/grid.ts:101
autoFillTracks
Section titled “autoFillTracks”Repeats Grid tracks to fill the available axis.
autoFillTracks: (...tracks: readonly GridTrack[]) => GridRepeatTrackRelated API: autoFillTracks, GridTrack, GridRepeatTrack.
Parameters
Section titled “Parameters”tracks— The track sequence to repeat.
Returns
Section titled “Returns”An immutable auto-fill track definition.
See also
Section titled “See also”View source — packages/core/src/lib/layout/grid.ts:110
autoFitTracks
Section titled “autoFitTracks”Repeats Grid tracks to fit occupied cells in the available axis.
autoFitTracks: (...tracks: readonly GridTrack[]) => GridRepeatTrackRelated API: autoFitTracks, GridTrack, GridRepeatTrack.
Parameters
Section titled “Parameters”tracks— The track sequence to repeat.
Returns
Section titled “Returns”An immutable auto-fit track definition.
See also
Section titled “See also”View source — packages/core/src/lib/layout/grid.ts:119
Implementation guidance for agents
Section titled “Implementation guidance for agents”Read the Drawing, layout, and effects companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.
Complete minimal examples
Section titled “Complete minimal examples”- Grid track constructors: Build fixed, repeated, auto-fill, and auto-fit grid track definitions. Plain source
Documentation version
Section titled “Documentation version”Documentation built with @pibbl/core 0.0.2, revision a1dcf8e. ALPHA — NOT FOR PRODUCTION USE.