ObjectStackObjectStack

Responsive

Responsive protocol schemas

Source: packages/spec/src/ui/responsive.zod.ts

TypeScript Usage

import { BreakpointColumnMapSchema, BreakpointName, BreakpointOrderMapSchema, ResponsiveConfigSchema, ResponsiveStylesSchema, StyleMapSchema } from '@objectstack/spec/ui';
import type { BreakpointColumnMap, BreakpointName, BreakpointOrderMap, ResponsiveConfig, ResponsiveStyles, StyleMap } from '@objectstack/spec/ui';

// Validate data
const result = BreakpointColumnMapSchema.parse(data);

BreakpointColumnMap

Grid columns per breakpoint (1-12)

Properties

PropertyTypeRequiredDescription
xsnumberoptional
smnumberoptional
mdnumberoptional
lgnumberoptional
xlnumberoptional
2xlnumberoptional

BreakpointName

Allowed Values

  • xs
  • sm
  • md
  • lg
  • xl
  • 2xl

BreakpointOrderMap

Display order per breakpoint

Properties

PropertyTypeRequiredDescription
xsnumberoptional
smnumberoptional
mdnumberoptional
lgnumberoptional
xlnumberoptional
2xlnumberoptional

ResponsiveConfig

Responsive layout configuration

Properties

PropertyTypeRequiredDescription
breakpointEnum<'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'>optionalMinimum breakpoint for visibility
hiddenOnEnum<'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'>[]optionalHide on these breakpoints
columns{ xs?: number; sm?: number; md?: number; lg?: number; … }optionalGrid columns per breakpoint
order{ xs?: number; sm?: number; md?: number; lg?: number; … }optionalDisplay order per breakpoint

ResponsiveStyles

Per-breakpoint scoped style maps (ADR-0065)

Properties

PropertyTypeRequiredDescription
largeRecord<string, string | number>optionalUnconditional base (desktop-first)
mediumRecord<string, string | number>optionalApplied at ≤ medium breakpoint
smallRecord<string, string | number>optionalApplied at ≤ small breakpoint
xsmallRecord<string, string | number>optionalApplied at ≤ xsmall breakpoint

StyleMap

CSS property → value map (camelCase keys; design tokens encouraged)

Type: Record<string, string | number>


On this page