Type to search pages and rules.

Browse pages

UI Pattern Decisions

Every recurring interface question is decided once and recorded in one catalog.

Markdown12 provisions

Intent#

Every recurring interface question is decided once and recorded in one catalog. Each entry holds the options considered, the option chosen, the compact-screen behavior, and the implementation per platform. Implementers build from the chosen option and extend the catalog rather than redrawing the pattern.

Concepts#

Pattern kinds#

A pattern answers one recurring question. Its kind states what the question is about.

KindThe question it answersExample
page-frameHow is a page of this kind laid out?A customer list page
elementHow does one control behave?Sorting on an invoice table
scenarioWhat shows in this situation?An order list with no orders

The catalog entry#

The catalog is one file valid against schemas/ui-pattern-catalog.schema.json. Each pattern entry carries these fields.

FieldWhat it holds
idThe slug other records cite
groupThe group the pattern belongs to
titleThe pattern name
questionThe recurring question the pattern answers
optionsAt least two options, each with rationale and cost
decisionThe chosen option, its source, and an optional record
compactThe breakpoint and the behavior below it
extensionsFurther options a reader may switch to
implementationsThe status and source paths per platform
libraryThe LiteSpec pattern ID the entry starts from, if any

The breakpoints map names viewport widths, and groups collect related patterns. The optional registry field names the command or path rendering every product-added option for review.

Pattern pages#

A pattern page holds one group of patterns, such as docs/frontend/patterns/record-detail.md. The folder holds no stack, so its pages apply wherever docs/frontend/ applies. Each ### heading under ## Patterns names one pattern, and its ID is litespec/frontend/patterns/<group>#<pattern-slug>. The heading is a name rather than an action, so the ID survives a change of default.

A pattern carries four labeled fields, then its options.

FieldWhat it holds
**Question:**The recurring question and its situation
**Default:**The option ID a project builds unless its catalog records another
**Compact:**How the default behaves on a narrow screen
**Rationale:**Why the default, the runner-up and when to prefer it, and what never to ship

Each option is a #### heading of the form #### `option-id`: Option name. It carries one wireframe block, an optional wireframe compact block for a different phone layout, then **Rationale:**, **Cost:** and an optional **Reference:**. An option ID is stable once published. The page's Standards hold the rules every option keeps.

The wireframe language#

A wireframe states the structure of one option: which parts sit where, in what order, which action is primary, and the copy they show. It states no color, font, spacing, or component library. An agent builds the option from the text in its own stack and design system. litespec patterns preview draws the text for a person to choose from.

option
Wireframe text
page
  breadcrumb "Orders" "SO-1042"
  header
    heading "SO-1042"
    status "Paid" positive
    action primary "Mark as shipped"
    menu "More"
      action "Duplicate"
      action destructive "Cancel order"
  split 2:1
    region "Items"
      table 3 "Item" "Qty" "Total"
        item: text "Oak desk lamp" · text "2" · text "EUR 90.00"
    aside
      card "Customer"
        fact "Name" "Maria Garcia"

Each line is one part: its name, its modifiers as bare words, its copy in double quotes, then a count or a ratio. Children are indented by two spaces. A line ending in : takes inline children, which sit side by side. A middle dot, U+00B7, with a space on each side separates them. A line starting with # is a comment. Copy is the real text the product would show, drawn from the Acme Supply cast.

The parts form a closed set.

GroupParts
Structurepage, header, footer, region, aside, card, row, split, tabs, nav, breadcrumb, toolbar
Contentheading, text, fact, figure, status, message, avatar, image, icon, link, divider
Actions and inputaction, menu, field
Collectionslist, table, grid, timeline, item
Overlaysdialog, drawer, popover, toast

The modifiers belong to their parts.

PartModifiers
actionprimary, secondary, destructive, quiet, disabled
fieldtext, number, date, select, textarea, checkbox, radio, toggle, search, file, and a value after =
status, message, toastneutral, positive, caution, critical, info
headingsmall
textmuted
linkcurrent
navside
footer, toolbar, asidesticky
drawerright, left, bottom

The validator holds each block to these rules.

RuleExample
One page, at the topA block never starts with header
A split holds one child per ratio partsplit 2:1 holds two children
A row holds at least two children
A list, grid, or timeline holds one template child and a countlist 3 with one item
A table names its columns and a counttable 4 "Item" "Qty"
A header, footer, toolbar, or overlay holds at most one primary action
An overlay is a child of page, after the page contentdialog last in page
A figure takes a value, a label and a value, or a label, a value, and a notefigure "Paid today" "EUR 1,240.00" "+12% on last week"
A toast holds only action children, such as Undo

On a phone the drawing reflows unless a wireframe compact block says otherwise. A row or split stacks, an aside follows the main content, a table keeps its first two columns, and a drawer rises from the bottom.

Starting a catalog entry from a LiteSpec pattern#

A catalog entry may set library to one pattern ID, such as litespec/frontend/patterns/record-detail#record-header, to start from that pattern. The entry keeps the pattern's option IDs and names, so a choice stays comparable across products, and it may add options of its own.

The owner chooses among the combined options with the drawings from litespec patterns preview, and records the source. The entry states the compact behavior and the implementation status per platform, and the platform team implements the chosen option in its own components. A choice that differs from the pattern's default records its reason in the entry.

The diagram shows the flow from a LiteSpec pattern through the catalog entry that cites it to the built screen.

From a LiteSpec pattern to a catalog entry to the built screen A LiteSpec pattern with three options and a named default; a catalog entry that cites the pattern by ID and records the chosen option with source owner; and the built loan detail screen. Arrows run from the pattern to the entry to the screen. LiteSpec pattern: Record header Catalog entry: loan-header Built screen 3 options; default title-state-breadcrumb-one-primary-action litespec/frontend/patterns/record-detail#record-header library cites the pattern ID decision: the default option, source owner compact: the header stacks under the title loan detail in the catalog app An arrow runs from a decision to what it produces.
A LiteSpec pattern with three options and a named default, a catalog entry citing the pattern by ID with the chosen option and source owner, and the built loan detail screen, with arrows from the pattern to the entry to the screen.

The decision lifecycle#

A choice starts as a recommendation and settles when an owner chooses. A later change names the record that made it.

StageMeaning
recommendedThe reviewer recommendation, standing until an owner chooses
ownerThe owner choice, with an optional note
owner or recommended, plus recordA later choice, naming the decision record that made it

The compact variant#

Each pattern states what happens below one named breakpoint. The chosen option reflows, or a named option replaces it.

FormMeaning
reflowThe chosen option adapts to the narrow width
replacementA named option from the entry is used instead

The breakpoint names one key of the catalog breakpoints map.

Implementation status#

Each platform entry states how far the chosen option is built there.

StatusMeaning
adoptedEvery surface follows the chosen option
partialThe shared implementation exists and some surfaces do not use it yet
pendingNo implementation exists yet
not-applicableThe platform has no such surface

A partial or pending entry states its gap in gap.

Patterns and floorplans#

A floorplan implements the chosen option of one page-frame pattern. The pattern decides the behavior, and the floorplan is the shared component carrying it.

Catalog sideShared package side
A page-frame pattern and its chosen optionThe floorplan implementing that option

Every page-frame pattern therefore resolves to one floorplan, and every floorplan traces to the pattern entry that chooses it.

Standards#

Keep one pattern catalog#

rulecheckable

Requirement A workspace with a controlled frontend MUST keep one pattern catalog at paths.uiPatterns in litespec.project.json, valid against the schema.

Rationale A decision kept in one catalog is found before it is remade. A decision kept in chat is decided again on the next page, and the two answers differ.

Example The project file points at the catalog.

JSON
{ "paths": { "uiPatterns": "docs/ui/patterns.json" } }
litespec/frontend/patterns#keep-one-pattern-catalog

Record every option considered#

rulecheckable

Requirement Each pattern MUST record at least two options with rationale and cost, and name the chosen option.

Rationale A later switch then reads the recorded cost instead of repeating the research. An option recorded without its cost is a preference, not a decision.

Example An invoice list considers two sort options: clickable headers and a menu listing sort fields. The entry records the rationale and cost of each, then names the chosen one.

litespec/frontend/patterns#record-every-option-considered

Record who chose#

ruleguidance

Requirement Each pattern decision MUST record its source as owner or recommended.

Rationale A recommended choice stands until an owner chooses. An agent never marks its own choice as the owner's. The catalog then shows which choices are settled and which await review.

Example For example, the library catalog starts its loan header entry from litespec/frontend/patterns/record-detail#record-header, keeps the pattern option IDs, and records the owner choice.

JSON
{
  "id": "loan-header",
  "group": "record-detail",
  "library": "litespec/frontend/patterns/record-detail#record-header",
  "decision": { "option": "title-state-breadcrumb-one-primary-action", "source": "owner" },
  "compact": { "breakpoint": "compact", "behavior": "The header stacks under the title." },
  "implementations": { "svelte": { "status": "adopted" } }
}

The entry names the pattern's default option and records owner as the source, so the choice stands as settled and the platform team builds it in its own components.

litespec/frontend/patterns#record-who-chose

Declare the compact behavior#

rulecheckable

Requirement Each pattern MUST name one breakpoint and state whether the chosen option reflows below it or a named option replaces it.

Rationale A pattern with no compact statement breaks on a narrow screen or is redrawn per route. The breakpoint is a catalog key, so every pattern names one width scale.

Example The entry names breakpoint compact; below it invoice rows render as cards.

litespec/frontend/patterns#declare-the-compact-behavior

Implement a chosen pattern once#

rulecheckable

Requirement The shared UI package MUST implement each chosen pattern once at the source paths the catalog names per platform.

Rationale One implementation keeps every route on the same behavior. A route redrawing the pattern is a second decision the catalog cannot track.

Example The catalog names one shared source path per platform, so every invoice route composes its platform path.

litespec/frontend/patterns#implement-a-chosen-pattern-once

Update the catalog with the code#

ruleguidance

Requirement A change that switches option, adds an option, or extends a pattern MUST update the catalog entry in the same change as its implementation.

Rationale A catalog updated later is a catalog updated never. A deliberate departure in one route names a decision record, so the exception stays reviewable.

Example A route departing from the chosen option names decision.record, such as docs/product/decisions/0014-invoice-sort-menu.md.

litespec/frontend/patterns#update-the-catalog-with-the-code

State the implementation status#

rulecheckable

Requirement Each platform entry MUST state one status and the gap when that status is partial or pending.

Rationale A reader then knows what is built and what is missing on each platform. The Concepts section defines the four values.

Example A pending entry for one platform states in gap what is missing there.

litespec/frontend/patterns#state-the-implementation-status

Keep the catalog platform neutral#

ruleguidance

Requirement A pattern MUST name behavior and structure, never a component library.

Rationale Platforms bind through implementations, so one catalog serves every selected stack. A library named in a pattern forces a second catalog per platform.

Example An option describes a menu listing sort fields rather than naming the component rendering it.

litespec/frontend/patterns#keep-the-catalog-platform-neutral

Conventions#

Keep a visual registry#

conventionguidance

Default Review LiteSpec options with litespec patterns preview, and draw only product-specific options in a product registry at compact and full widths.

Replacement A consumer can replace this default with an explicit local convention.

Rationale An option seen beside its rivals is judged on appearance rather than description. The preview already draws every LiteSpec option, so a product registry draws only the patterns and options the product added. The product registry command or path lives in the catalog registry field.

litespec/frontend/patterns#keep-a-visual-registry

Report pattern feedback after the work#

conventionguidance

Default Finish the task on the chosen pattern, then report a proposal in the completion report with pattern id, change, reason, and affected option.

Replacement A consumer can replace this default with an explicit local convention.

Rationale An agent never changes a decision on its own and never stops mid-task to ask. The owner accepts, refuses, or defers the proposal, and an accepted proposal follows litespec/frontend/patterns#update-the-catalog-with-the-code.

litespec/frontend/patterns#report-pattern-feedback-after-the-work

Start from a LiteSpec pattern#

conventionguidance

Default Start each catalog entry from its LiteSpec pattern, through library, and keep the pattern's option IDs, option names, and default.

Replacement Start an entry without library and record why no LiteSpec pattern fits.

Rationale A shared starting point keeps choices comparable across products and keeps the LiteSpec default visible. A product choosing a different option records its reason in the entry, so the departure stays reviewable.

litespec/frontend/patterns#start-from-a-litespec-pattern

Promote pattern improvements#

conventionguidance

Default Send an accepted proposal that is not specific to one product to the LiteSpec pattern page, as a new option or a refined one.

Replacement A consumer can replace this default with an explicit local convention.

Rationale The patterns improve from use across products, while each product keeps its own choices. The proposal follows litespec/frontend/patterns#report-pattern-feedback-after-the-work, and it reaches the pattern page after the owner accepts it.

litespec/frontend/patterns#promote-pattern-improvements

Verification#

IDMarkEvidence
litespec/frontend/patterns#keep-one-pattern-catalogcheckablelitespec ui reports a missing catalog or a schema failure.
litespec/frontend/patterns#record-every-option-consideredcheckablelitespec ui reports fewer than two options or a choice naming no option.
litespec/frontend/patterns#record-who-choseguidanceDoes each decision record owner or recommended, with no agent-marked owner choice?
litespec/frontend/patterns#declare-the-compact-behaviorcheckablelitespec ui reports a compact option naming no recorded option.
litespec/frontend/patterns#implement-a-chosen-pattern-oncecheckablelitespec ui reports a named component path that does not exist.
litespec/frontend/patterns#update-the-catalog-with-the-codeguidanceDid the catalog entry change with its implementation or name a record?
litespec/frontend/patterns#state-the-implementation-statuscheckablelitespec ui reports a partial or pending entry without a gap.
litespec/frontend/patterns#keep-the-catalog-platform-neutralguidanceDoes any pattern name a component library outside implementations?
litespec/frontend/patterns#keep-a-visual-registryguidanceDoes the registry render every product-added option in each theme at compact and full widths?
litespec/frontend/patterns#report-pattern-feedback-after-the-workguidanceDoes each completion report carry proposals with pattern id, change, reason, and option?
litespec/frontend/patterns#start-from-a-litespec-patternguidanceDoes each entry set library or record its own reason, keeping the pattern's option IDs?
litespec/frontend/patterns#promote-pattern-improvementsguidanceDid each accepted generic proposal reach the LiteSpec pattern page as a new or refined option?