Skip to content

@jsvision/ui / fixed

Function: fixed()

fixed<V>(view, n): V

Defined in: ui/src/view/dsl.ts:155

Give a view a fixed size of n cells along its container's main axis (columns in a row, rows in a col). Mutates the view's layout.size (preserving its other layout props) and returns the same view, so it composes inline inside a col/row.

Type Parameters

V

V extends View

Parameters

view

V

The view to size.

n

number

The fixed extent in whole cells.

Returns

V

The same view, for inline chaining.

Example

ts
import { col, fixed, grow } from '@jsvision/ui';

// A 3-row status bar pinned below a growing body.
const app = col(grow(body), fixed(statusBar, 3));