Skip to content

Primitives

Primitives are not another UI kit inventory. They are Varo runtime contracts for state, triggers, overlays, positioning, and dismiss behavior so H5 and mini-program wrappers share the same interaction semantics. Presentation components stay in the component docs; this section keeps the behavior building blocks.

01

Runtime contract

Root owns state and context, Trigger owns entry, Content/Overlay owns the visible layer, and Close owns exit. Platforms may change rendering details, not the contract.

02

Composition order

Place Root first, then Trigger, then Overlay and Content. Stable composition keeps business blocks consistent across H5 and mini-programs.

03

Controlled and uncontrolled

Use internal state for local UI. Switch to controlled mode when routing, analytics, or form coordination needs an external source of truth.

Catalog

Browse the current 17 public primitives by capability. Every page includes an H5 live preview, a mini-program runtime contract, copyable code, and API reference.

Foundation

2

Selection & Toggle

6

Content & Layout

3

Disclosure & Floating

3

Layers

3

Next foundational candidates

More primitives are not automatically better. A behavior moves down only when state, keyboard/touch interaction, or dismiss logic would otherwise be repeated by several components.

CandidateEnablesWhy it belongs below UI
TooltipTooltips, chart hints, truncated-copy helpDelayed open, hover/focus, and dismiss policy
Menu / DropdownMenuDropdown, context, and action menusRoving focus, arrow keys, and item activation
ToggleGroupSegmented controls, formatting bars, filtersSingle/multiple selection and roving focus
SliderVolume, range, and parameter controlsBounds, step, keyboard, and drag state
Combobox / ListboxSearch select, remote select, command paletteInput, filtering, active option, and selection
ToastGlobal feedback, async results, undoQueue, lifecycle, pause, and dismiss behavior

Prioritize Menu, Tooltip, ToggleGroup, and Slider, then evaluate Combobox and Toast; their cross-runtime input models need explicit H5 and mini-program boundaries first.

Product boundaries

  • Primitives own behavior contracts: controlled/uncontrolled state, disabled rules, ARIA, data-* attributes, and dismiss events.
  • UI wrappers own visuals and positioning: tokens, motion, icons, floating placement, and platform rendering details.
  • Business wrappers own data and product policy: remote search, permissions, pagination, domain models, and copy.

This split keeps Base Kit source readable and editable. Teams can build their own UI packages on the same primitives without forking state machines.

Authoring rules

  • H5 and mini-program share the same part names and state model.
  • Values inside one TabsRoot / AccordionRoot must stay unique.
  • Mini-program docs never pretend a browser render is a real mini-program preview; they use a runtime contract table instead.
  • Build custom product UI upward from primitives, or continue with the component docs and the upcoming Blocks authoring guide.