Skip to content

Grid track definitions

Read as Markdown

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.

Creates an immutable bounded Grid track.

minmax: (options: Readonly<{ min: GridTrackBreadth; max: GridTrackBreadth; }>) => GridMinMaxTrack

Related API: minmax, GridTrackBreadth, GridMinMaxTrack.

  • options — The minimum and maximum breadths.

An immutable minmax track definition.

GridTrack

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

Repeats Grid tracks a fixed number of times.

repeatTracks: (tracks: readonly GridTrack[], options: Readonly<{ count: number; }>) => GridRepeatTrack

Related API: repeatTracks, GridTrack, GridRepeatTrack.

  • tracks — The track sequence to repeat.

  • options — The repeat count.

An immutable repeated track definition.

GridTrack

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

Repeats Grid tracks to fill the available axis.

autoFillTracks: (...tracks: readonly GridTrack[]) => GridRepeatTrack

Related API: autoFillTracks, GridTrack, GridRepeatTrack.

  • tracks — The track sequence to repeat.

An immutable auto-fill track definition.

GridTrack

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

Repeats Grid tracks to fit occupied cells in the available axis.

autoFitTracks: (...tracks: readonly GridTrack[]) => GridRepeatTrack

Related API: autoFitTracks, GridTrack, GridRepeatTrack.

  • tracks — The track sequence to repeat.

An immutable auto-fit track definition.

GridTrack

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

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 a1dcf8e. ALPHA — NOT FOR PRODUCTION USE.