Components

XML v2 exposes a small, data-oriented Astryx component set. The old HTML aliases and compound slot tags are not supported. Use component attributes for labels, values, and state, then compose components with Stack, Grid, Card, and FormLayout.

Every interactive control needs an accessible label or i18n value. Localized interpolation data belongs in one values expression object; arbitrary placeholder attributes are rejected by the schema.

Text, Heading, and Code

Text replaces paragraph and inline HTML aliases. Heading requires an explicit semantic level from 1 to 6. Both accept literal value, localized i18n, or nested XML content. Code renders inline code with the same content precedence.

  • values: expression resolving to an object used for translation placeholders.
  • count: numeric expression used for plural translation entries.
  • Text as: span, p, div, or label.
  • Text type: body, large, label, supporting, code, a display style, or inherit.

Link replaces the old anchor alias. Use to for application navigation and href for a URL. External destinations can set isExternalLink; translated link text uses i18n.

Icon

Icon renders a semantic Astryx icon name rather than a Lucide slug. Common names include info, success, warning, error, search, and wrench.

Avatar

Avatar is a single data-oriented element. Set its image, fallback image, name, and alternative text as attributes instead of using image and fallback children. Sizes are tiny, xsmall, small, medium, and large.

Badge

Badge requires a serializable label or an i18n key. Status variants include neutral, info, success, warning, and error.

Banner displays persistent status information. It requires a title or i18n key and can expand to show child content.

Divider

Divider replaces the horizontal-rule alias. It supports horizontal or vertical orientation, optional translated labels, and subtle or strong variants.

Button and ButtonGroup

Button requires a label or i18n key. Use isDisabled, isLoading, and isIconOnly for state. ButtonGroup accepts Button or Action children and also requires an accessible group label.

  • variant: primary, secondary, ghost, or destructive.
  • type: button, submit, or reset.
  • append and item: append a resolved item to array state before running the nearest Action.

TextInput, NumberInput, FileInput, and TextArea

These controls replace Input, Textarea, Field, and InputGroup compounds. Each control owns its label, description, validation status, and value. A $state.path value creates a writable binding.

  • label or i18n: required accessible field label, even when isLabelHidden is true.
  • isRequired, isOptional, isDisabled: explicit field states.
  • status: warning, error, or success, with optional statusMessage.
  • NumberInput writes numbers. FileInput keeps File values available to Action form payloads.

CheckboxInput, Switch, and Slider

Boolean and range controls also bind through value. Use a State object with a value field when the control owns the entire state slot.

Selector

Selector replaces the Select compound. It requires an accessible label and one or more flat SelectorOption children. Each option requires a value and uses label or i18n for visible text.

RadioList

RadioList replaces RadioGroup and contains flat RadioListItem children. The list and every item require accessible labels.

Table

Table replaces DataTable and its slot compounds. It consumes array data and flat TableColumn children. Every column needs a key or dotted field; use an explicit key for custom cells. Child content becomes the cell renderer and can read the configured row name, index, and value.

  • data: required expression resolving to an array of objects.
  • rowName: row variable exposed to custom cells. Defaults to row.
  • idKey: optional stable row identifier field.
  • emptyLabel: literal empty-state text.