Skip to main content
cngx-src documentation

createStripDensity

Functioncommon/stepper

projects/common/stepper/strip-density.ts

Description#

Resolves the classic strip's density rung from its own container width against the step count and two per-step px thresholds. Pure create* factory, sibling to createStepperDisplayMode - it owns a ResizeObserver the way the display-mode factory owns a matchMedia listener, and returns a single derived Signal.

'comfortable' density short-circuits to 'full' (no measurement dependency). Before the first measurement (width === 0) and for an empty strip the rung is 'full', so the strip never flashes 'minimal' on mount.

Signature#

createStripDensity(options: CngxStripDensityOptions)

Parameters#

Returns#

Signal