Recipes
Developer preview
This feature is in developer preview. Use with caution as it may change unexpectedly. For more information, contact us.
Each recipe gives a solution for one task, with complete code. The recipes start from the app of the Tutorial.
Routing, data and locales#
| Recipe | Task |
|---|---|
| Resolve compositions on a page | Render more than one composition, change composition data before render, or render a composition in an ordinary Next.js route. |
| Localize your app | Show each page in the correct locale, in the live site, the preview and the static build. |
| Call Uniform APIs on the server | Get compositions, routes, project map nodes and the manifest with the Next.js data cache. |
Pages and layout#
| Recipe | Task |
|---|---|
| Global header and footer | Show a header and a footer that authors manage in Uniform on all pages. |
| SEO | Set the page title and description from the composition, make a sitemap from the project map, and set canonical URLs. |
| Custom 404 page | Show a 404 page, with content from Uniform if you want. |
| Hybrid pages | Add Uniform regions to pages that are built in Next.js already. |
Components#
| Recipe | Task |
|---|---|
| Images | Show image parameters with next/image. |
| Links | Show link parameters with next/link. |
| Data fetching | Get more data in a component, for example from a product API. |
| Client components | Put an interactive component in a slot. |
| Forms | Put a form in a slot, and send it to a Server Action. |