prongs
GitHub

Reference

Intents

Every intent Prongs ships, grouped by profile and domain: the 123 starter intents prongs add, prongs add errors and prongs add logs put in your registry, and 28 more in packs for particular kinds of app. Each page shows the intent in use, how to tell it apart from its neighbours, and how it connects to other intents.

New in 0.3.0

layout.toast, feedback.busy, layout.empty, dialog.sheet, layout.intro, layout.split, layout.details, field.date, field.file, action.copy, heading.group.

Profiles

UI

11 domains

What each element is for. Rendered by the components.

npx prongs add

Errors

7 domains

What went wrong, told to the caller. Returned with fail().

npx prongs add errors

Logs

5 domains

What happened, told to whoever runs the app. Recorded with log().

npx prongs add logs

How intents are named

An intent is one named purpose. Pick the domain from what the code is, then the intent from what it is for.

action

Domain

the kind of thing

delete

Meaning

what it is for

Domains belong to a profile. The UI profile renders action.delete as a destructive button; the errors profile turns record.missing into a 404.

Choosing an intent

  • 1

    Match the purpose, not the look. Pick the intent whose description says what the element or code is for.

  • 2

    Read its “not for” lines. If one matches your case, use the intent it points to.

  • 3

    Nothing fits? Add one. npx prongs add-intent, instead of working around the system.

  • 4

    Check it. npx prongs check verifies usage, and runs after every edit when hooks are installed.

See the full guide

UI

What each element is for. Rendered by the components.

Heading

heading.*

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

<Text> · 4 intents + 2 in packs

Text

text.*

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

<Text> · 11 intents + 4 in packs

Feedback

feedback.*

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

<Text> · 5 intents

Action

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.

<Action> · 10 intents + 5 in packs

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

<Action> · 6 intents + 2 in packs

Choice

choice.*

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

<Action> · 4 intents + 1 in packs

Field

field.*

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

<Field> · 14 intents

Layout

layout.*

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

<Layout> · 33 intents + 9 in packs

Media

media.*

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

<Media> · 2 intents + 3 in packs

Dialog

dialog.*

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

<Dialog> · 3 intents + 2 in packs

Popover

popover.*

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

<Popover> · 3 intents

Packs

Intents only some kinds of app need, added on top of the starter with prongs add <pack>. Each pack's intents still belong to the usual domains, so they are listed there too, marked with their pack.

SaaS

6 intents

Apps people work in: records in tables, settings pages, plans and billing.

npx prongs add saas

Editorial

9 intents

Things people read: articles, posts, docs, news and their previews.

npx prongs add editorial

Marketing

3 intents

Landing and product pages: the headline and the links that lead on.

npx prongs add marketing

Dashboard

4 intents

Numbers to watch: amounts in a range, charts, devices and their status.

npx prongs add dashboard

Media

6 intents

Photos, video and music: galleries, players and full-size views.

npx prongs add media

Errors

What went wrong, told to the caller. Returned with fail().

Request

request.*

The caller’s request was wrong: unreadable, incomplete, or a value that breaks a rule. 400 or 422.

4004223 intents

Auth

auth.*

No valid credentials: nobody signed in, an expired session, a bad token or secret. 401.

4014 intents

Permission

permission.*

Valid credentials, but not allowed to do this. 403.

4031 intent

Record

record.*

The thing asked for is not there, as far as the caller may know. 404.

4041 intent

Conflict

conflict.*

The request clashes with the current state: it already exists, or it is not possible yet. 409.

4092 intents

Limit

limit.*

Too many requests, or an allowance used up. 429.

4291 intent

Failure

failure.*

Our fault or a dependency’s. The caller sees a generic message; the details are logged. 5xx.

5005025033 intents

Logs

What happened, told to whoever runs the app. Recorded with log().

Audit

audit.*

Who did what, kept as a record: things created, changed, deleted, and changes to access.

info5 intents

Security

security.*

Signals worth watching: failed sign-ins, bad tokens, rate limits, probing.

warn3 intents

Incident

incident.*

Something broke or degraded, and someone should look.

errorwarn2 intents

Job

job.*

Background work: syncs, backups, migrations, scheduled runs.

info2 intents

Debug

debug.*

Detail for working on the code, dropped in production.

debug1 intent