Usage
CrudPage from @prepared911/ui-blocks is the standard assembly for list-first admin surfaces: a page header for route identity, a toolbar for search or filters plus the page’s primary CTA, and a body region for DataTable (or a list plus detail pane). It matches the mental model of “DataTable paired with a CTA button and page header” in one predictable vertical stack.
PageHeader alone or a bespoke layout.TakeoverPage.Regions render in a fixed order regardless of how you order children in JSX:
CrudPageHeader: wraps PageHeader without the actions prop; primary CTAs belong in the toolbar instead.CrudPageAlert (optional): persistent slot between header and toolbar for Callout, Banner, or similar.CrudPageToolbar: DataTableToolbar from @prepared911/ui-data-table: filters, applied chips, and actions (typically one primary button).CrudPageBody or any other children; loose children are auto-wrapped in a column flex body when CrudPageBody is omitted.See API and Development for how children are partitioned into slots.
| Concern | Choice |
|---|---|
| Chrome | CrudPageVariant.Default inherits surrounding page chrome. CrudPageVariant.Card adds background, border, and radius for embedding in modals, drawers, or nested dashboards. |
| Body layout | Default: direct children (e.g. DataTable) are wrapped in a column flex with gap. Use CrudPageBody when you need a row layout (list + detail) or a custom gap / flexDirection; then the default wrapper is skipped. |
| Child order | CrudPageHeader, CrudPageAlert, and CrudPageToolbar are collected and rendered in the slot order above; you can still write them in any order in JSX. |
overflow: hidden so the body region owns vertical scroll while header, alert, and toolbar stay visible.CrudPageToolbar with Filter and useFilteredData from @prepared911/ui-data-table for local search; pass manualPagination, pages, and onPageChange on DataTable for server-style pages.CrudPageAlert for notices that must stay above the table (sync paused, read-only integration, maintenance).Do
CrudPageToolbar.actions (create, upload, export).CrudPageHeader; keep filter chips and search in the toolbar.CrudPageBody when composing a table beside a drawer or secondary pane so direction and overflow stay explicit.Don’t
CrudPageHeader—it omits actions by design.CrudPageAlert or a Callout in the alert slot.Keyboard and heading behavior follow PageHeader, DataTableToolbar, and DataTable. See Accessibility for this block.