# Intents

Every starter intent, grouped by profile and domain: the 214 intents prongs add, prongs add errors and prongs add logs put in your registry. Each page shows the intent in use, how to tell it apart from its neighbours, and how it connects to other intents.

## Profiles

- [UI](https://www.prongs.dev/docs/intents/ui.md) (11 domains): What each element is for. Rendered by the components. Add it with `npx prongs add`.
- [Errors](https://www.prongs.dev/docs/intents/errors.md) (7 domains): What went wrong, told to the caller. Returned with [`fail()`](https://www.prongs.dev/docs/profiles/errors.md). Add it with `npx prongs add errors`.
- [Logs](https://www.prongs.dev/docs/intents/logs.md) (5 domains): What happened, told to whoever runs the app. Recorded with [`log()`](https://www.prongs.dev/docs/profiles/logs.md). Add it with `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.delete`](https://www.prongs.dev/docs/intents/action/delete.md) = `action` (the domain: the kind of thing) + `delete` (the meaning: what it is for). Domains belong to a profile: the UI profile renders [`action.delete`](https://www.prongs.dev/docs/intents/action/delete.md) as a destructive button; the errors profile turns [`record.missing`](https://www.prongs.dev/docs/intents/record/missing.md) 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](https://www.prongs.dev/docs/naming.md)

## UI

What each element is for. Rendered by the components.

- [`heading.*`](https://www.prongs.dev/docs/intents/heading.md) Heading: Titles that give a page its structure, from the marketing headline down to the title of one item. ([`<Text>`](https://www.prongs.dev/docs/components/text.md), 6 intents)
- [`text.*`](https://www.prongs.dev/docs/intents/text.md) Text: Running text and the small pieces around it: introductions, captions, labels, facts about an item, code. ([`<Text>`](https://www.prongs.dev/docs/components/text.md), 27 intents)
- [`feedback.*`](https://www.prongs.dev/docs/intents/feedback.md) Feedback: Messages about what just happened or is happening. They are announced to screen readers. ([`<Text>`](https://www.prongs.dev/docs/components/text.md), 4 intents)
- [`action.*`](https://www.prongs.dev/docs/intents/action.md) Action: Commands, named for what they do: save, delete, share. With an href they render a link, without one a button. ([`<Action>`](https://www.prongs.dev/docs/components/action.md), 27 intents)
- [`nav.*`](https://www.prongs.dev/docs/intents/nav.md) Navigation: Moving around: the home link, pages of the site, views of the same content, steps of a flow. ([`<Action>`](https://www.prongs.dev/docs/components/action.md), 10 intents)
- [`choice.*`](https://www.prongs.dev/docs/intents/choice.md) Choice: Picking from a small set shown all at once: options for a setting, filters, colours. ([`<Action>`](https://www.prongs.dev/docs/components/action.md), 4 intents)
- [`field.*`](https://www.prongs.dev/docs/intents/field.md) Field: What the user types or picks in a form. The intent sets the element, the input type, the input mode and autocomplete. ([`<Field>`](https://www.prongs.dev/docs/components/field.md), 14 intents)
- [`layout.*`](https://www.prongs.dev/docs/intents/layout.md) Layout: Page regions and groups. The intent picks the element (main, section, form, ul…) and the arrangement. ([`<Layout>`](https://www.prongs.dev/docs/components/layout.md), 80 intents)
- [`media.*`](https://www.prongs.dev/docs/intents/media.md) Media: Images that identify a person or illustrate content, with a text fallback when there is no image. ([`<Media>`](https://www.prongs.dev/docs/components/media.md), 5 intents)
- [`dialog.*`](https://www.prongs.dev/docs/intents/dialog.md) Dialog: Modal interruptions built on the native <dialog>: a task, a confirmation, a full-screen reader. ([`<Dialog>`](https://www.prongs.dev/docs/components/dialog.md), 5 intents)
- [`popover.*`](https://www.prongs.dev/docs/intents/popover.md) Popover: Things that open next to the button that opened them without blocking the page: menus, pickers, extra detail. ([`<Popover>`](https://www.prongs.dev/docs/components/popover.md), 4 intents)

## Errors

What went wrong, told to the caller. Returned with [`fail()`](https://www.prongs.dev/docs/profiles/errors.md).

- [`request.*`](https://www.prongs.dev/docs/intents/request.md) Request: The caller’s request was wrong: unreadable, incomplete, or a value that breaks a rule. 400 or 422. (400, 422; 3 intents)
- [`auth.*`](https://www.prongs.dev/docs/intents/auth.md) Auth: No valid credentials: nobody signed in, an expired session, a bad token or secret. 401. (401; 4 intents)
- [`permission.*`](https://www.prongs.dev/docs/intents/permission.md) Permission: Valid credentials, but not allowed to do this. 403. (403; 1 intent)
- [`record.*`](https://www.prongs.dev/docs/intents/record.md) Record: The thing asked for is not there, as far as the caller may know. 404. (404; 1 intent)
- [`conflict.*`](https://www.prongs.dev/docs/intents/conflict.md) Conflict: The request clashes with the current state: it already exists, or it is not possible yet. 409. (409; 2 intents)
- [`limit.*`](https://www.prongs.dev/docs/intents/limit.md) Limit: Too many requests, or an allowance used up. 429. (429; 1 intent)
- [`failure.*`](https://www.prongs.dev/docs/intents/failure.md) Failure: Our fault or a dependency’s. The caller sees a generic message; the details are logged. 5xx. (500, 502, 503; 3 intents)

## Logs

What happened, told to whoever runs the app. Recorded with [`log()`](https://www.prongs.dev/docs/profiles/logs.md).

- [`audit.*`](https://www.prongs.dev/docs/intents/audit.md) Audit: Who did what, kept as a record: things created, changed, deleted, and changes to access. (info; 5 intents)
- [`security.*`](https://www.prongs.dev/docs/intents/security.md) Security: Signals worth watching: failed sign-ins, bad tokens, rate limits, probing. (warn; 3 intents)
- [`incident.*`](https://www.prongs.dev/docs/intents/incident.md) Incident: Something broke or degraded, and someone should look. (error, warn; 2 intents)
- [`job.*`](https://www.prongs.dev/docs/intents/job.md) Job: Background work: syncs, backups, migrations, scheduled runs. (info; 2 intents)
- [`debug.*`](https://www.prongs.dev/docs/intents/debug.md) Debug: Detail for working on the code, dropped in production. (debug; 1 intent)
