Recipes
Task-focused guides with complete code for every Birch UI product, from persisting grid state to importing MS Project files.
Each recipe solves one concrete task end to end: the setup, complete code you can paste, how it works, and the pitfalls. Most include a live demo. There are 33 recipes.
Data grid#
| Recipe | What you build |
|---|---|
| Persist grid state to localStorage | Save sorting, filters, column layout, selection and expansion with getState() and restore them with setState() on the next visit. |
| Load rows from a REST API | Connect the server-side row model to a REST endpoint with fetch, translate each block request into a query string and cancel stale requests with AbortSignal. |
| Load rows from GraphQL | Back the server-side row model with a GraphQL query, passing sort, filters and the requested block as variables and cancelling stale queries. |
| Excel export with custom styles | Export the grid view to .xlsx and restyle it to match your brand, with a title row, coloured headers, conditional fills and number formats. |
| Editable grid with validation and undo | Validate user input with valueParser and editable callbacks, show feedback, and let users undo and redo edits with undoRedo, api.undo() and api.redo(). |
| Nested grids in master/detail | Show each customer's orders in a nested grid, and each order's lines in a third level, with MasterDetailModule and correct cleanup. |
| Show a million rows | Render, sort and scroll one million client-side rows with row and column virtualization, and the habits that keep a large grid fast. |
| Keyboard-only workflows | Set up a grid that power users and keyboard-only users can drive end to end, from navigation and editing to menus, filters, undo, ranges and the clipboard. |
| Translate the grid and support right-to-left | Run the grid in German with a bundled locale pack, add your own Arabic strings with plural forms, and lay it out right to left. |
| Migrate an AG Grid app with the CLI | Move an existing AG Grid code base to Birch UI Grid with birchui-migrate, from a dry run and report to applying the changes and clearing manual steps. |
| Match your design system | Map your design tokens onto the grid's --lq-* custom properties to build a named theme with light and dark variants, density and accessible contrast. |
| Birch UI Grid in the Next.js App Router | Render the grid from a Client Component in the Next.js App Router, load data in a Server Component, lazy-load Grid Pro and pass the license key from an environment variable. |
| Grid Pro in an Angular standalone app | Use the birchui-grid component in a standalone, zoneless Angular app with signal inputs, a computed options object, outputs and Grid Pro modules. |
| Collapsible column groups | Group related columns under shared headers with ColumnGroupDef, make groups collapsible with columnGroupShow, and open or close them from code. |
| Custom cell context menu | Add row actions to the grid's right-click menu, keep or drop the built-in copy and export items, and disable the menu entirely with the contextMenu option. |
| Streaming live updates | Apply a stream of WebSocket messages to the grid with batched applyTransaction calls, flash changed cells and keep sorting and selection stable. |
| Import an Excel file into a grid | Read an uploaded .xlsx file with readXlsx, turn its rows into typed records with sheetToObjects, validate them and show them in a grid for review. |
Pivot Studio#
| Recipe | What you build |
|---|---|
| Save and load pivot layouts | Let users save named Pivot Studio layouts as PivotReport JSON, keep them in localStorage or on your server, and open them again. |
| Load pivot data from an API or CSV | Fetch records from a JSON API or a CSV export, clean them with parseCsv or csvToRecords, and load them into Pivot Studio with loading and error states. |
Scheduler#
| Recipe | What you build |
|---|---|
| Validate scheduler drag and drop | Combine validateDrop and validateResize to block double bookings, keep jobs inside working hours and only assign work to qualified technicians. |
| Schedule recurring maintenance jobs | Model planned maintenance with SchedulerEvent.rrule and exdates, let users edit one occurrence or the whole series, and store detached occurrences. |
| Undo and redo in the scheduler | Turn on scheduler history with the undoRedo option, add undo and redo buttons driven by historyChange, and keep a server in step when users undo. |
| Save scheduler changes to a server | Persist every scheduler edit from historyChange, batch requests, roll back changes the server rejects, and apply updates from other users without echoing them back. |
Gantt#
| Recipe | What you build |
|---|---|
| Import and export MS Project files | Let users open MS Project XML files in the Gantt with a preview step, keep your own task fields across a round trip, and export the schedule back to XML. |
| Build a critical path report | Use the headless Gantt engine to compute the critical path, slack and constraint conflicts of a project, and render them as a report or an Excel file. |
Spreadsheet#
| Recipe | What you build |
|---|---|
| Add custom worksheet functions | Define reusable workbook functions with LAMBDA and defined names, share them across sheets, and test them with the headless formula engine. |
| Load and save xlsx files | Open xlsx files from a file input, a URL or drag and drop, save them back to a server as xlsx or workbook JSON, and convert files on the server without the component. |
Forms#
| Recipe | What you build |
|---|---|
| Save Form Builder schemas and render them | Persist schemas from the Form Builder with versioning and server-side checks, then load the published version and render it with createForm. |
| Validate form submissions on the server | Re-check submitted answers on the server with JSON Schema and the expression engine, run async checks while users type, and show the server's errors next to the right fields. |
Event Calendar#
| Recipe | What you build |
|---|---|
| Publish and subscribe to iCalendar feeds | Serve a team's events as a subscribable .ics feed with toICS, show external feeds in the Event Calendar with parseICS, and import .ics files without duplicates. |
Charts#
| Recipe | What you build |
|---|---|
| Build a chart dashboard from a grid | Drive several charts from the rows a Birch UI Grid shows, so filtering the grid updates the dashboard, and chart a selected range with chartFromRange. |
Diagram#
| Recipe | What you build |
|---|---|
| Save, load and auto-arrange diagrams | Persist diagrams as DiagramDocument JSON, restore them with fromJSON, lay out graphs that arrive without coordinates, and keep layout results out of your change log. |
Excel Engine#
| Recipe | What you build |
|---|---|
| Build a multi-sheet Excel report | Write a styled monthly report with a summary sheet, a detail sheet and per-depot outlines using writeXlsx, with cross-sheet formulas and cached values. |
More help#
- Examples gallery for complete starter apps.
- Troubleshooting pages in each product section, starting with the grid.