Components

The 24 semantic components, what "semantic" means, and how the renderer turns meaning into concrete controls.

Polyxd has 24 components. Each one describes what something is for, not what it looks like. The generator picks components; the renderer and the design-system pack decide how they appear on each platform.

For every component's props, usage rules, accessibility requirements and platform mappings, see the generated components reference. This page explains the ideas behind them.

By category#

Category Components
Structure Section, Group, Card, Disclosure, Views
Content Text, Metric, DetailList, Collection, Table, Chart, Media
Feedback Status
Input TextInput, Choice, Toggle, DateInput, RangeInput, Form
Action Action, ActionBar
Flow Steps, Confirm, Comparison

The source of truth is packages/spec/components/*.json. The UI schema, the A2UI catalog and the reference page are all generated from those files.

What "semantic" means#

A concrete component library has RadioGroup, Select, SegmentedControl and Combobox. Polyxd has one Choice: "pick one or several options from a known set." Which control that becomes depends on the number of options, their length, the screen width and the platform. That is a rendering decision, so the model doesn't make it.

Each component definition carries:

Some decisions are deliberately taken away from the model. Heading levels follow nesting depth. Table column alignment follows the column's format. Chart type follows the chart's intent. The primary action is limited to one per view.

How the renderer chooses controls#

These are the rules the web renderer (@polyxd/react) applies today.

Choice#

Options Rendered as
Single choice, 2–4 options, each label 20 characters or fewer, no descriptions Segmented control
Single choice, otherwise Radio list
Multiple choice Checkbox list
More than 10 options (either mode) The list gets a filter box above it

The spec also allows a select on compact screens for 5–10 single-choice options; the web renderer currently keeps radios.

Toggle#

With an action, a Toggle is a switch that applies immediately. Inside a Form without an action, it is a checkbox submitted with the form.

Table#

Tables use the surface's own width, through container queries, not the viewport. Below 36rem the header row is visually hidden and each row becomes a stacked card of label/value pairs. Numeric alignment comes from each column's format.

Chart#

A Chart states an intent, not a chart type:

Intent Rendered as
trend Line chart, with per-series markers so series differ by more than colour
comparison Bar chart
composition Share bar with a legend
distribution Bar chart (the spec's rule is a histogram)

Every chart shows its written summary and includes the data as a table, so people who can't see the chart and agents reading the accessibility tree get the same information. Series colours use color.data.categorical.1 to .6 in order.

Other layout rules#

Where to go next#

Polyxd is an early preview. Found something unclear? It will get better with your feedback.