App components / Modals
Modal templates
The Modal filled for fifty everyday situations: confirms, sign in, invites and sharing, settings, billing, uploads, new things and AI review. Pick a situation and the title, mono context line, body and actions come ready, as a centred dialog on desktop and a bottom sheet on phones.
Code
The component itself, ready to drop into your project. Switch between React, Vue and plain HTML; every version uses the same Tailwind classes on Ochre's tokens.
Delete Q3 roadmap
Project · 24 issues · 6 people
The project, its issues, comments and files are deleted for everyone. This can't be undone.
Installation
Examples
Open any of them
Every situation by group, opened as a dialog. On a phone each one rises as a bottom sheet.
Confirm
Account
People
Forms
Settings
Billing
Files
Create
AI
Pick a situation
Your own copy
content swaps the words of a situation and keeps its layout.
Motion
Built on Ochre's ease-out curves. With reduced motion switched on, everything still works, it just doesn't move.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| situation | ModalSituation | – | One of the fifty: "delete", "session-expired", "confirm", "confirm-with-summary", "unsaved-changes", "delete-with-typed-name", "done", "sign-in", "create-account", "single-sign-on", "verify-email", "two-step-code", "confirm-password", "recovery-codes", "invite-by-email", "invite-with-roles", "share-link", "share-with-people", "request-access", "transfer-ownership", "pick-people", "rename", "details-form", "checkbox-options", "toggle-settings", "choose-one", "labels", "appearance", "notifications", "profile", "keyboard-shortcuts", "choose-a-plan", "confirm-upgrade", "payment-method", "billing-details", "limit-reached", "cancel-plan", "upload-files", "upload-images", "import", "export", "crop-image", "new-project", "new-event", "pick-a-date", "ask-ochre", "review-ai-changes", "connect-an-app", "agent-permissions", "whats-new". |
| open | boolean | false | Whether the dialog is showing. |
| onClose | () => void | – | Called on esc, a click outside, and after any action that closes. |
| onAction | (action, situation) => void | – | Called with the action pressed. ⌘↵ presses the confirming one. Actions with role stay keep the dialog open. |
| inline | boolean | false | Draw the tray in place instead of opening a dialog, for previews and galleries. |
| breakpoint | "desktop" | "mobile" | "desktop" | With inline: the centred dialog, or the bottom sheet with stacked, 48 px touch controls. Opened as a dialog it follows the screen. |
| content | Partial<ModalTemplateData> | – | Replaces parts of the situation: title, context, description, hint, blocks or actions. |
| MODAL_TEMPLATES | Record<ModalSituation, ModalTemplateData> | – | All the copy as data: name, group, size, title, context, description, hint, blocks and actions. |
| MODAL_SITUATIONS | { id, name, group }[] | – | The fifty in order with their Figma names, for pickers and galleries. |
Usage
Use it for
- Starting a dialog for a common job (delete, invite, connect an app) without writing its copy and layout from scratch.
- Reviewing every dialog in a product side by side, in place, at Desktop and Mobile.
Avoid
- Situations that need more than about five fields: use a Slide-out panel.
- Keeping the sample copy as it is. Swap names and numbers for your own through content or MODAL_TEMPLATES.