Skip to content
Playground

Design principles

The product and engineering decisions that keep Zenos coherent.

Zenos helps teams build dense, dependable product interfaces without hiding the platform beneath another layer of abstraction. Its components share one visual language and one public API, while remaining flexible enough for real application work.

The system separates responsibility deliberately. Native HTML supplies semantics, Base UI supplies complex interaction behavior, generated CSS applies the visual system, Zenos defines the public contract, and the consuming application owns product meaning and workflows.

Design decision loop

Move from meaning to evidence

Visual polish follows a clear responsibility, correct behavior, and a stable public contract.
  1. Meaning

    What responsibility does this UI own?

    A clear name and one reason to change
  2. Semantics

    Which native element or interaction model fits?

    Expected keyboard and assistive behavior
  3. Composition

    Can existing public parts express it?

    No private reach-through or premature abstraction
  4. System

    Which semantic role and API convention apply?

    Theme-safe tokens and predictable props
  5. Resilience

    What happens outside the ideal example?

    Long, empty, narrow, RTL, zoomed, reduced motion
  6. Proof

    Which behavior demonstrates correctness?

    Types, interaction tests, rendered review, build

When principles compete

Resolve trade-offs in this order

  1. Trustworthy behavior Semantics, access, focus, keyboard, and state remain correct.
  2. Clear public contract The call site communicates responsibility without hidden coupling.
  3. System consistency Tokens, naming, sizing, and composition follow established conventions.
  4. Localized flexibility Escape hatches solve product needs without becoming the primary API.

Clear before clever. Names, states, and component anatomy should explain themselves at the call site. Familiar concepts use familiar vocabulary.

Compose before abstracting. Small public parts combine into real workflows. New abstractions earn their place through repeated product needs.

Structure stays neutral. Layout primitives control space and flow. Decoration remains an intentional choice made with semantic tokens.

Behavior stays trustworthy. Native and Base UI semantics survive styling, wrapping, polymorphism, and custom composition.

Information leads. Hierarchy, spacing, and contrast help people scan dense interfaces without unnecessary visual noise.

Escape hatches remain useful. Public components accept native props, className, style, ARIA attributes, and data attributes without exposing internals.

Use the element or component that matches the content’s responsibility. A Button performs an action. A Link navigates. Field owns labels, descriptions, errors, and validation semantics. InputGroup only arranges related controls.

Visual similarity is not enough reason to merge responsibilities. Keeping boundaries narrow makes components easier to combine, test, and replace.

When a component starts to own data fetching, authorization, product copy, and several unrelated layouts, split it by responsibility rather than adding more configuration props.

Components use roles such as background, surface, foreground, border, and primary. They do not depend on a specific shade working in every theme. The same rule applies to spacing, elevation, typography, and status colors.

Primitive values remain available for theme authors. Product code should prefer semantic tokens so light mode, dark mode, and custom themes preserve the intended hierarchy.

Hardcoded values are appropriate only when they represent fixed content rather than a theme decision. A logo’s authored color may be fixed; a success message should use the semantic success role.

Compound components expose meaningful parts such as Root, Trigger, Content, Item, and Indicator. Consumers can arrange those parts around their content without depending on private wrappers.

TSX
<Dialog.Root>  <Dialog.Trigger render={<Button />}>Review changes</Dialog.Trigger>  <Dialog.Content>    <Dialog.Title>Publish changes?</Dialog.Title>    <Dialog.Description>The update will be visible to every member.</Dialog.Description>    <Dialog.Close>Cancel</Dialog.Close>  </Dialog.Content></Dialog.Root>

Layout uses the polymorphic as prop. Base UI-backed interactive parts use render. Keeping these mechanisms distinct makes their purpose predictable.

Zenos components must continue to work with long labels, empty results, validation errors, narrow containers, increased browser zoom, RTL content, and reduced motion. Responsive behavior should follow the available space rather than assume one ideal screen.

Truncation is reserved for content that can safely lose visual detail. Essential instructions, errors, and actions should wrap or remain otherwise available.

Dense product interfaces should reduce wasted space, not remove hierarchy. Use proximity to group related information, alignment to make comparison easier, and contrast to identify the next decision. Give primary actions and exceptional states more emphasis than persistent chrome.

Do not solve density by shrinking every control or muting every label. Touch targets, focus indicators, readable type, and error recovery remain usable at compact densities. Test scanning with realistic data, not only symmetrical placeholders.

A component is not finished at its default appearance. Review hover, pressed, selected, focused, disabled, invalid, loading, empty, and destructive states where they apply. The state must remain understandable through more than color alone.

Loading should preserve enough structure to prevent avoidable layout shift. Empty states should explain what is absent and, when appropriate, how to proceed. Destructive actions should communicate consequence before commitment and recovery after failure.

Motion should explain spatial or state change, not delay work. Keep transitions interruptible, avoid motion that competes with reading, and provide an equivalent reduced-motion treatment.

Zenos preserves native HTML and Base UI behavior, including keyboard interaction, focus management, ARIA relationships, and disabled semantics. Consumers remain responsible for meaningful labels, useful error messages, logical workflows, and content order.

Automated checks catch common regressions. Keyboard testing, screen-reader review, zoom, contrast, motion, and real content remain part of the design process.

Accessibility is a constraint throughout design, implementation, and content—not a final audit. A visually elegant treatment that obscures a label, removes focus, breaks source order, or depends on pointer precision is not a valid system outcome.

Calendar, carousel, chart, and data-table behavior comes from focused third-party engines installed through recipes. These dependencies are added only when a product requests the corresponding recipe, and the generated source belongs to that product.

Core Zenos stays focused on general-purpose controls, layout, tokens, and interaction patterns.

ConcernConvention
Layout polymorphismas
Interactive compositionrender
Value statevalue, defaultValue, onValueChange
Open stateopen, defaultOpen, onOpenChange
Visual treatmentvariant
Control sizingsize="sm", size="md", or size="lg"
Interaction orientationorientation="horizontal" or orientation="vertical"
State semanticsdisabled, invalid, required
DOM identificationdata-slot, plus data-size and data-variant when relevant
Styling escape hatchesclassName, style, aria-*, and data-*

Consistency is a product feature. A new API should reuse these conventions unless the underlying concept is genuinely different.

Before accepting a new component, variant, token, or pattern, ask:

  1. Does it have one clear owner and responsibility?
  2. Can an existing public component or composition already express the need?
  3. Does the API match established state, size, variant, and composition conventions?
  4. Are native props, refs, keyboard behavior, focus, and ARIA relationships preserved?
  5. Does it work with real content, responsive containers, themes, zoom, RTL, and reduced motion where relevant?
  6. Are specialized dependencies isolated from the core package?
  7. Do examples, types, tests, and rendered behavior prove the same public contract?

Prefer the smallest complete addition. A narrow primitive with a stable responsibility is easier to compose and maintain than a broad component that predicts every future product need.