🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@czap/quantizer

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@czap/quantizer

Turn continuous signals into a few named UI states for LiteShip: evaluate boundaries, animate the transitions between states, and gate motion by device tier.

latest
Source
npmnpm
Version
0.10.0
Version published
Weekly downloads
613
-23.85%
Maintainers
1
Weekly downloads
 
Created
Source

@czap/quantizer

Turns a boundary — named states over numeric thresholds — into a live state machine that emits per-state outputs (CSS, shader uniforms, ARIA attributes) when a value crosses a threshold.

Install this directly when you need live boundary evaluation outside a framework integration. If you're starting a new project, start with liteship or @czap/astro instead.

Install

pnpm add @czap/quantizer effect@beta

effect must be the Effect 4 beta (effect@beta) — a bare pnpm add effect installs 3.x and fails the peer check.

30 seconds

import { Boundary } from '@czap/core';
import { Q } from '@czap/quantizer';
import { Effect } from 'effect';

const width = Boundary.make({
  input: 'width',
  at: [[0, 'sm'], [768, 'lg']],
});

const config = Q.from(width).outputs({
  css: { sm: { display: 'block' }, lg: { display: 'grid' } },
});

const outputs = Effect.runSync(Effect.scoped(
  Effect.gen(function* () {
    const live = yield* config.create();
    live.evaluate(1024);
    return yield* live.currentOutputs;
  }),
));

console.log(outputs.css); // { display: 'grid' }

Logs { display: 'grid' } — the CSS output for the lg state that 1024 falls into. For a one-off lookup without Effect, the synchronous evaluate(boundary, value) export returns { state, index, value, crossed } directly.

Where it sits

This is a layered package between definitions and hosts: it imports Boundary, easing, and content-address utilities from @czap/core — its only @czap dependency. Compiling outputs to static CSS text for a build step is @czap/compiler's job; this package is for runtime, where the value keeps changing. See the package surfaces map for the full layout.

If it does nothing

If you pass tier to Q.from(boundary, { tier }), outputs for targets outside that motion tier are silently dropped — tier: 'none' permits only ARIA, so CSS outputs never emit and nothing warns you. Omit tier to allow all targets, or call .force('css') on the builder to override the gate per target.

Docs

Part of LiteShip — powered by the CZAP engine (Content-Zoned Adaptive Projection), distributed as @czap/* packages.

Keywords

czap

FAQs

Package last updated on 14 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts