basicCatalog top-level property

A2uiCatalog basicCatalog
final

The A2UI "Basic Catalog" (v0.9), mirroring the components published by the A2UI basic catalog. Use this to render standard UI without defining your own design system.

Declared with A2uiCatalogComponent.simple, which emits the spec's catalog.json schema shape. Parameter order matches the published catalog, since it is the positional argument order in A2UI Express (a test pins this).

It is deliberately narrower than the published schema, to steer the model toward what renders well: components do not take the shared weight property, and Icon.name accepts only the basicIconNames (not a data binding or an SVG path). Load the published catalog.json with loadCatalog(file:) for the full schema.

Implementation

final A2uiCatalog basicCatalog = A2uiCatalog(
  id: basicCatalogId,
  functions: basicFunctions,
  components: [
    A2uiCatalogComponent.simple(
      name: 'Text',
      description:
          'Displays a run of text. For headings/titles set the `variant` prop '
          '(h1..h5) rather than embedding Markdown; the text itself may use '
          'inline Markdown.',
      params: [
        const A2uiParam.dynamicValue(
          'text',
          required: true,
          description: 'The text content to display.',
        ),
        const A2uiParam.string(
          'variant',
          description: 'A hint for the base text style.',
          enumValues: ['h1', 'h2', 'h3', 'h4', 'h5', 'caption', 'body'],
        ),
      ],
    ),
    A2uiCatalogComponent.simple(
      name: 'Image',
      description: 'Displays an image from a URL.',
      params: [
        const A2uiParam.dynamicValue(
          'url',
          required: true,
          description: 'The URL of the image to display.',
        ),
        const A2uiParam.dynamicValue(
          'description',
          description: 'Accessibility text for the image.',
        ),
        const A2uiParam.string(
          'fit',
          description: 'How the image is resized to fit its container.',
          enumValues: ['contain', 'cover', 'fill', 'none', 'scaleDown'],
        ),
        const A2uiParam.string(
          'variant',
          description: 'A hint for the image size and style.',
          enumValues: [
            'icon',
            'avatar',
            'smallFeature',
            'mediumFeature',
            'largeFeature',
            'header',
          ],
        ),
      ],
    ),
    A2uiCatalogComponent.simple(
      name: 'Icon',
      description:
          'Displays a named material icon. `name` MUST be one of the exact '
          'names listed - do NOT invent names (e.g. there is no "cloud", '
          '"air", or "thermostat"). If none fits, omit the Icon.',
      params: [
        A2uiParam.string(
          'name',
          required: true,
          description: 'The name of the icon to display.',
          enumValues: basicIconNames,
        ),
      ],
    ),
    A2uiCatalogComponent.simple(
      name: 'Row',
      description: 'Lays out children horizontally.',
      params: [
        const A2uiParam.children(
          'children',
          required: true,
          description: 'The ids of the child components.',
        ),
        const A2uiParam.string(
          'justify',
          description: 'Arrangement of children along the main axis.',
          enumValues: [
            'start',
            'center',
            'end',
            'spaceAround',
            'spaceBetween',
            'spaceEvenly',
            'stretch',
          ],
        ),
        A2uiParam.string(
          'align',
          description: 'Alignment of children along the cross axis.',
          enumValues: ['start', 'center', 'end', 'stretch'],
        ),
      ],
    ),
    A2uiCatalogComponent.simple(
      name: 'Column',
      description: 'Lays out children vertically.',
      params: [
        A2uiParam.children(
          'children',
          required: true,
          description: 'The ids of the child components.',
        ),
        A2uiParam.string(
          'justify',
          description: 'Arrangement of children along the main axis.',
          enumValues: [
            'start',
            'center',
            'end',
            'spaceBetween',
            'spaceAround',
            'spaceEvenly',
            'stretch',
          ],
        ),
        A2uiParam.string(
          'align',
          description: 'Alignment of children along the cross axis.',
          enumValues: ['start', 'center', 'end', 'stretch'],
        ),
      ],
    ),
    A2uiCatalogComponent.simple(
      name: 'List',
      description:
          'A list of children. Use `_template(path, itemVar)` for `children` '
          'to generate items from a data-model list.',
      params: [
        A2uiParam.children(
          'children',
          required: true,
          description:
              'A fixed list of child ids, or a _template(...) binding.',
        ),
        A2uiParam.string(
          'direction',
          description: 'The direction items are laid out in.',
          enumValues: ['vertical', 'horizontal'],
        ),
        A2uiParam.string(
          'align',
          description: 'Alignment of children along the cross axis.',
          enumValues: ['start', 'center', 'end', 'stretch'],
        ),
      ],
    ),
    A2uiCatalogComponent.simple(
      name: 'Card',
      description: 'A visually-contained card wrapping a single child.',
      params: [
        A2uiParam.child(
          'child',
          required: true,
          description:
              'The id of the single child. Wrap multiple elements in a '
              'Column or Row and pass that container id here.',
        ),
      ],
    ),
    A2uiCatalogComponent.simple(
      name: 'Divider',
      description: 'A horizontal or vertical separator line.',
      params: [
        A2uiParam.string(
          'axis',
          description: 'The orientation of the divider.',
          enumValues: ['horizontal', 'vertical'],
        ),
      ],
    ),
    A2uiCatalogComponent.simple(
      name: 'Button',
      description: 'A clickable button that fires an action back to the agent.',
      params: [
        A2uiParam.child(
          'child',
          required: true,
          description: 'The id of the child, usually a Text component.',
        ),
        A2uiParam.string(
          'variant',
          description: 'A hint for the button style.',
          enumValues: ['default', 'primary', 'borderless'],
        ),
        A2uiParam.action(
          'action',
          required: true,
          description:
              'The action to fire, e.g. Event("refresh"). The event name is '
              'sent back to the agent when the button is pressed.',
        ),
      ],
      checkable: true,
    ),
    A2uiCatalogComponent.simple(
      name: 'TextField',
      description: 'A single- or multi-line text input.',
      params: [
        A2uiParam.dynamicValue(
          'label',
          required: true,
          description: 'The text label for the input field.',
        ),
        A2uiParam.dynamicValue(
          'value',
          description: 'The value of the text field.',
        ),
        A2uiParam.string(
          'variant',
          description: 'The type of input field to display.',
          enumValues: ['shortText', 'longText', 'number', 'obscured'],
        ),
      ],
      checkable: true,
    ),
    A2uiCatalogComponent.simple(
      name: 'CheckBox',
      description: 'A labeled checkbox.',
      params: [
        A2uiParam.dynamicValue(
          'label',
          required: true,
          description: 'The text to display next to the checkbox.',
        ),
        A2uiParam.dynamicValue(
          'value',
          required: true,
          description: 'The current state of the checkbox.',
          type: .boolean,
        ),
      ],
      checkable: true,
    ),
    A2uiCatalogComponent.simple(
      name: 'Slider',
      description: 'A numeric slider.',
      params: [
        A2uiParam.dynamicValue(
          'label',
          description: 'The label for the slider.',
        ),
        A2uiParam.number('min', description: 'The minimum value.'),
        A2uiParam.number(
          'max',
          required: true,
          description: 'The maximum value.',
        ),
        A2uiParam.dynamicValue(
          'value',
          required: true,
          description: 'The current value.',
          type: .number,
        ),
      ],
      checkable: true,
    ),
  ],
);