prongs
GitHub

Action

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.

Pattern

action.*

Component

Intents

In packs

Intents

Does what a form, dialog or step exists for: send, save, create, confirm, next, pay, and the submit of a form that begins something, like Sign up. Pass verb="save", "create", "pay"... to name it for analytics.

The main action of a page or region that begins something: New project, Get started, Sign up, Start a trial. Pass verb="create", "signup"... to name it for analytics.

Backs out or says no without keeping anything: cancel, discard, decline an invitation, not now

Permanently destroys data

Turns a state on or off and shows which: follow, subscribe, like. Pass pressed={on}

Does something and stays on the page: edit, add, remove, retry, share, open, back, refresh, duplicate, move, download, archive, sign out. The label says the verb; pass verb="duplicate", "archive"... to name it for analytics. Pass tone="danger" when it is destructive or hard to undo, like leaving a workspace.

action.copy<button>

Copies a value to the clipboard: an ID, an API key, a link, a code snippet. Show that it copied

Closes or hides something without changing data: a dialog, notice or menu

Opens a menu or shows content in place: the more-actions button on a row, show password, show more

Goes to another page or place, from inside a sentence or on its own: an inline link, Learn more, Terms, Forgot password?

From the SaaS pack

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

Opens the details of a record in a table, on its name: the whole row opens it, while the other controls in the row, like its menu, still work on their own

action.sort<button>

Sorts a table by a column: the button inside its th. Put aria-sort="ascending" or "descending" on the th of the sorted column; the arrow follows it

Starts or manages paying for more: upgrade, change plan, manage billing

From the Marketing pack

Landing and product pages: the headline and the links that lead on. Add it with npx prongs add marketing.

action.more<button>

A link on its own to more about what is above it: Learn more, See all, Full changelog. Write only the words

From the Media pack

Photos, video and music: galleries, players and full-size views. Add it with npx prongs add media.

action.skip<button>

Moves to the next or previous item in a sequence someone steps through: the next track, the previous episode, the next photo in a dialog.media

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.