Recipes
Every recipe here starts from a real situation: a screen a production app
needs, with the states it really has (loading, empty, error, success, phone). Instead
of showing one component on its own, the recipe brings together the
tempest-react-sdk pieces that solve that screen and shows the code file by
file, complete, with its imports. You copy, paste and adapt. 🚀
Where to start
- Never used the SDK? Follow the Tutorial first: it builds one concept per page, and the recipes assume what it teaches.
- Need a screen like yours? Pick a use case below.
- Want to see everything together in a whole app? Go straight to the integrated example.
- Just one specific piece (dark mode, ⌘K, a zod form)? The quick recipes are short.
Common prerequisites
Every recipe assumes an app created by
create-tempest-app, or a Vite + React + TS app with the SDK
installed and its CSS imported once in the entrypoint
(Manual installation). When a recipe talks to
a backend, the contract is that of a FastAPI service built on
tempest-fastapi-sdk, described in FastAPI integration.
How each recipe is written
Every page follows the same path, so you know where to look:
- The situation — who uses the screen and what it has to do.
- What we will build — the list of behaviours, including the error and small-screen states.
- The code, file by file — each block is a whole file, with its path on the
first line. Every block with an
importis compiled against the SDK in the package's test suite, so the example does not fall behind when the API changes. - Piece by piece — why each piece is there.
- Recap — what to take to your app.
Use cases
| Recipe | The situation | Main pieces |
|---|---|---|
| CRUD admin panel | A store's back office: list, search, filter, create, edit and delete records. | server-paginated table, zod form, overlay, toast, HTTP client and query |
| BR sign-up + checkout | The customer signs up with CPF, CEP and phone and pays with Pix or card. | BR inputs, MoneyInput, CEP lookup, Pix and card checkout |
| Live trip (map + WebSocket) | The driver and the passenger follow the trip on the map, in real time. | LiveRouteMap, LiveRouteMapLegend, WebSocket, road matching |
| Real-time messenger | A support chat with history, attachments and messages arriving live. | chat components, WebSocket, optimistic send, upload |
| Share with a WhatsApp preview | The driver spreads the ride in a group, and the message arrives with image, title and link; the QR frame goes as a file or is downloaded. | ShareActions, ShareButton, useShare, whatsAppShareUrl, tempest-fastapi-sdk's make_share_router (/s/{id}) |
| Offline field app | A technician records visits with no signal and syncs when the network comes back. | offline queue, photo capture, resumable upload, zip export |
Integrated example
Management app: a small, whole app, with sign-in, role-protected routes, a layout with navigation, a dashboard with charts, a records module and a settings screen. It is the place to see how the pieces of the recipes above fit into a single project, from the folder tree to the last file.
Quick recipes
Short answers to an "I want to do X". They were the sections of the old Cookbook, now one per page:
- Complete authentication flow
- Paginated list with search and sorting
- Form with zod validation
- Dark mode without flash
- Offline-first
- ⌘K command palette
- App from scratch in 1 minute
Full-stack with FastAPI
Two recipes span the frontend and the backend together:
- FastAPI integration (full-stack): typed errors,
X-Request-ID,Retry-After, pagination and authentication end to end. - Offline Sync (FastAPI): the SDK's offline queue talking to the backend's sync endpoint.
Recap
- Recipe = one real screen, with all its states, complete code file by file.
- The examples compile against the SDK in the package's suite.
- Start with the Tutorial, pick the use case closest to yours, and use the integrated example as the map of the whole app.