prongs
GitHub

Choice

Picking from a small set shown all at once: options for a setting, filters, colours.

Pattern

choice.*

Component

Intents

In packs

Intents

One of a small set of values, exactly one of which is chosen: a theme, a size, a time slot, a plan. Pass pressed on the chosen one

Narrows which items are shown: All, Unread, a source. Pass pressed while it applies

choice.color<button>

Picks a colour from presets. Pass the colour as vars={{ "--choice-color": value }} and pressed on the chosen one

choice.open<button>

Shows what is picked and opens the choices to change it: a sort order, sources. The trigger of a Popover picker

From the SaaS pack

Apps people work in: records in tables, settings pages, plans and billing. Add it with npx prongs add saas.

choice.bulk<button>

Picks a row to act on together with others: the checkbox at the start of a table row. Pass pressed while picked; show a layout.toolbar of actions while any are picked

Choosing a domain

Find the row that describes your case, and use the domain on the right.

  • If the problem is

    Use

  • Titles that give a page its structure, from the marketing headline down to the title of one item.

    heading.*
  • Running text and the small pieces around it: introductions, captions, labels, facts about an item, code.

    text.*
  • Messages about what just happened or is happening. They are announced to screen readers.

    feedback.*
  • What pressing it does: finish a form, start something, run a command, delete. The verb itself goes in the verb prop. With an href they render a link, without one a button.

    action.*
  • Moving around: the home link, pages of the site, views of the same content, steps of a flow.

    nav.*
  • Picking from a small set shown all at once: options for a setting, filters, colours.

    choice.*
  • What the user types or picks in a form. The intent sets the element, the input type, the input mode and autocomplete.

    field.*
  • Page regions and groups. The intent picks the element (main, section, form, ul…) and the arrangement.

    layout.*
  • Images that identify a person or illustrate content, with a text fallback when there is no image.

    media.*
  • Modal interruptions built on the native <dialog>: a task, a confirmation, a full-screen reader.

    dialog.*
  • Things that open next to the button that opened them without blocking the page: menus, pickers, extra detail.

    popover.*

For registry authors

Starter intents. These are the intents prongs add puts in your registry, shown in this site’s theme. Yours are your own registry.ts: rename, restyle and add to them, and see them with prongs add gallery.