Skip to content
AI Building

Build an Atrium app with AI

One minimised file with everything an AI tool needs: how to work, the hard rules, the full app contract and the design system. Upload it to any LLM, then describe your app.

ATRIUM-AI-BUILD.mdMarkdown
  1. Upload the file to ChatGPT, Claude, Cursor or any AI tool (or paste its contents).
  2. Describe the app you want in plain English.
  3. Let the AI ask you for the API key when it needs one.
View the file
Auto

Component · Form elements

Field: label, hint and error

View .md

Stable

A field wraps every form control: the label, an optional hint, an error message when the answer is wrong, and the control itself. Using it everywhere keeps forms evenly spaced and makes errors look the same on every screen.

Show errors after the manager tries to save, not while they are still typing.

In pounds, before VAT.

Enter a price, like 12.50


Specifications

Anatomy

In pounds, before VAT.

Enter a price, like 12.50

1) Label (.at-label)
font-size: var(--at-text-sm) /* 14px */
font-weight: var(--at-weight-bold)
2) Hint (.at-hint)
font-size: var(--at-text-sm)
color: var(--at-text-subtle)
3) Error (.at-error)
font-size: var(--at-text-sm)
font-weight: var(--at-weight-bold)
color: var(--at-text-danger)
4) Control
.at-input, .at-textarea or .at-select
in an error field: border: 2px solid var(--at-border-danger)

Size and spacing

Inside a field
display: flex; flex-direction: column
gap: var(--at-space-2) /* 4px */
Between fields
wrap fields in .at-stack
gap: var(--at-space-5) /* 16px */

Field

Label and control. Add a hint only when it helps.

Example

Field with hint

A hint between the label and the control explains format or limits. Link it with aria-describedby.

Example

In pounds, before VAT.

Field with error

Add .at-field--error and an .at-error message above the control. Set aria-invalid="true" and add the error id to aria-describedby.

Example

Enter an email address, like name@example.com


Usage

When to use

  • Around every text input, textarea, select and date input.

When not to use

  • Checkboxes and radios: use a fieldset with a legend instead.

Content

  • Error messages say how to fix it: "Enter a price, like 12.50", not "Invalid".
  • Hints describe format or limits; they do not repeat the label.
  • If a form has several errors, also show an error alert at the top.

Do and don't

Enter a price, like 12.50

DoThe error says what to type.

Invalid input

Don'tA vague error, placed after the field where it is easy to miss.

Do

  • Say how to fix it: "Enter a price, like 12.50".

Don't

  • Show errors before the user has submitted.
  • Only colour the border: always show the message.

Implementation

HTML

<div class="at-field at-field--error">
  <label class="at-label" for="amount">Monthly price</label>
  <p class="at-hint" id="amount-hint">In pounds, before VAT.</p>
  <p class="at-error" id="amount-error">Enter a price, like 12.50</p>
  <input class="at-input" id="amount" type="text" inputmode="decimal" aria-describedby="amount-hint amount-error" aria-invalid="true" />
</div>

Classes

ClassWhat it does
at-fieldWrapper
at-field--errorError state: red, thicker border
at-labelLabel
at-hintHelp text
at-errorError message

Tokens used

--at-text-subtle, --at-text-danger


Accessibility

  • Point aria-describedby at the hint and error; set aria-invalid="true" on error.

Related