UI Design Principles
These apply to every surface document regardless of which loop is active.
Component Semantics
Use the most semantically precise component available. Do not use stack + text where list or table is appropriate. Do not use card + stack where modal or accordion solves the layout problem natively.
Prefer components in this order: semantic container first (tabs, accordion, stepper, modal) → layout (stack, row, grid) → generic (card, section).
Accessibility by Default
- Every
input,select,checkbox, andslidermust have alabelattribute. - Every primary
buttonmust have a label or text content. - Navigation
linkitems must have alabelattribute. - Interactive regions (tabs, accordions, steppers) must have enough structure for a screen reader to follow — label every panel, step, and tab.
- Do not use
placeholderas a substitute for real content in interactive areas. Reserveplaceholderfor genuinely unknown visual elements.
Feature Linkage
Every \{% surface %\} tag must have a for attribute pointing to a valid qualified id (feature, flow, or action). Do not create a surface without a corresponding feature or flow to link it to.
Verify the linked document exists before writing:
get_document("feature/{id}")Layout Hierarchy
- One
sectionornavper screen — this is the outermost shell. cardandmodalgroup related content within a section.stackandrowhandle spacing and alignment within cards.- Do not nest
sectioninsidesectionorcardinsidecardwithout a clear rationale.
Placeholder Discipline
Use placeholder for visual elements that are not yet designed, not for laziness. Every placeholder must have a type and a label. At status: review, no placeholder should remain without a comment explaining why it is deferred.