Database builder
A React block (a whole screen) in Beamline's Research & design app.
What a database does for the people who use it, built in one place. Templates: starting values per property (a relation default points at an existing record and keeps pointing) and content sections, with the editing context always said (the template, which new pages get, or one page made from it, whose changes stay on that page); Save makes a new revision and each page shows the revision it came from. Repeat: a template made into a new page on a schedule (recurrence-editor and a time), the next run in the workspace's zone, every run kept with the page it made or why it didn't (Retry); off keeps the template and every page; a template nesting databases deeper than allowed can't repeat and says why. Form: questions mapped to properties, synced (renaming the label renames the property, said before saving) or label-only (the property keeps its name); a required property the form doesn't ask is said; a respondent preview whose answers are never saved; closed says so. Button: ordered steps (make a page in a database from a template, edit a page, open a page, notify) using this page's values, the page an earlier step made or the person who clicked; a step pointing at nothing or at a later step is marked and stops it running; tried on a real page step by step, a failure stops the rest, which say why, and nothing opens an earlier page in place of one that wasn't made.
Use it for
- A workspace tool where a database's templates, recurring pages, intake form and page buttons are set up.
- Any builder where editing a template must never be confused with editing a record made from it.
Not for
- Laying out one record type's page (record-setup).
- Visual node-graph automation (workflow-builder).
Anatomy
- bar: the database and workspace; Templates, Repeat, Form or Button
- templates: templates with revision and page count, pages made from the chosen one with their revision, New page from template; the editing banner; starting values; content sections; Save template or Save page
- repeat: the template, Make a new page on a schedule, the rule, the time, the next run, Save schedule; runs with their pages or reasons and Retry
- form: title, questions (synced or label-only), add a question per property not asked; the question's label, sync, required, help, most choices; accepting responses; Save form; the respondent preview
- button: label, ask before running, steps (number, kind, database and template or which page, the values it sets, move and remove), Save button; trying it on a page with each step's result and a summary; the confirmation
States
- templates: empty template, editing starting values, saved as a new revision, a new page from it, a page from an older revision, editing a page, relation preset, no permission
- repeat: off (template and pages kept), scheduled, next run, made, failed run with Retry, too nested to repeat
- form: synced rename, label detached, required property missing, preview, preview submitted (nothing saved), closed
- button: editing, missing database, a page pointed at that no earlier step makes, ready, confirmation, running, partial failure, completed
- narrow room: columns stack
Keyboard
- Tab reaches every template, page, question and step; Enter or Space opens it; steps move with their up and down buttons
Motion
A run's steps turn from waiting to running to done or failed in turn; the shared spinner turns only while a step runs. Nothing runs at rest.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
database (required) | string | — | The database's name ("Bugs"). |
workspace | string | — | Where it lives, in words ("Product team"). |
properties | DbProperty[] | — | |
defaultProperties | DbProperty[] | — | |
onPropertiesChange | ((properties: DbProperty[]) => void) | — | |
people (required) | string[] | — | People who can be picked for person properties and notifications. |
related (required) | RelatedRecord[] | — | Pages of related databases a relation can point to. |
templates | PageTemplate[] | — | |
defaultTemplates | PageTemplate[] | — | |
onTemplatesChange | ((templates: PageTemplate[]) => void) | — | |
records | DbRecord[] | — | |
defaultRecords | DbRecord[] | — | |
onRecordsChange | ((records: DbRecord[]) => void) | — | |
schedules | RepeatSchedule[] | — | |
defaultSchedules | RepeatSchedule[] | — | |
onSchedulesChange | ((schedules: RepeatSchedule[]) => void) | — | |
form (required) | DbForm | — | |
button (required) | PageButton | — | |
databases (required) | ButtonDatabase[] | — | Databases a button step can make pages in, with their properties (this one included). |
canEditTemplates | boolean | — | May change templates (others can still make pages from them). Default true. |
maxRepeatNesting | number | — | How deep databases may nest in a template that repeats. Default 2. |
zone (required) | string | — | The workspace's time zone in words. |
now (required) | string | — | Now, ISO. |
tryPage (required) | { id: string; title: string; values: Record<string, string>; } | — | The page the button is tried on, and who clicks it. |
clicker (required) | string | — | |
defaultView | DatabaseBuilderView | — | |
defaultTemplate | string | — | |
defaultTemplateDraft | Partial<PageTemplate> | — | |
defaultScheduleDraft | Partial<RepeatSchedule> | — | |
defaultQuestion | string | — | |
defaultFormDraft | Partial<DbForm> | — | |
defaultButtonDraft | Partial<PageButton> | — | |
onSaveTemplate | ((template: PageTemplate) => Promise<PageTemplate>) | — | |
onCreateFromTemplate | ((template: PageTemplate) => Promise<DbRecord>) | — | Makes a page from the template's saved revision; resolve with the page. |
onSaveSchedule | ((schedule: RepeatSchedule) => Promise<RepeatSchedule>) | — | |
onRetryRun | ((schedule: RepeatSchedule, run: RepeatRun) => Promise<RepeatRun>) | — | |
onSaveForm | SaveForm | — | Saves the form with the properties its synced labels rename (property id → new name). |
onSaveButton | ((button: PageButton) => Promise<PageButton>) | — | |
onRunStep | RunStep | — | Runs one step of the button; reject to stop the run there. |
locale | string | — | |
className | string | — | Classes on the documented visual root; no override by default. |
style | CSSProperties | — | Inline styles on the documented visual root; no overrides by default. |
ref | Ref<HTMLDivElement> | — | Receives the documented native target or imperative handle; omitted by default. |
Built from
- segmented-control
- select
- input
- textarea
- switch
- number-field
- recurrence-editor
- time-picker
- dialog
- spinner
- button
Dependencies
lucide-react
Import
import { DatabaseBuilder } from "@beamline/database-builder";
Get it
Database builder is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent
More in Research & design
- Research synthesis: A research study turned into evidence in one place. Transcripts: passages marked as accepted highlights or as the assistant's suggestions (dashed)…
- Study setup: Set up an unmoderated test and its screener. Test: what's tested (a website, a prototype by its share link, an app by its store page), who takes it…
- Study flow: A study's blocks in order, each with where people go next. A block that routes by its answer (multiple choice, scale, open question, prototype task) has…
- Participant review: One participant's session, answer by answer, beside the list of everyone who took the study. The list filters (finished, left early, with a recording)…
- Click heatmap: One screen of a usability task as it looked (your prototype's frame or a page built from your parts, scaled into a phone) with where people clicked over…
- Tree test: A tree test: build a navigation tree and read where people went. Build: pages added at the top or under any page, indented under the page above or moved…
- Prototype task: A prototype task in a study. The linked prototype refreshes from the design keeping the task and paths (a start screen gone from the new version said, a…
- Task results: A usability task's results, from headline outcomes down to paths and screens. Outcomes (direct success, indirect success, gave up) say their share and…
- Matrix question: A matrix question and the participant's side of it, side by side. Rows (up to ten) share one set of choices (two to seven); Enter adds a row, several…
- Prototype review: Reviewing a design file's clickable prototype. Present: the board on a stage with its wireframe, the flow chosen (an unavailable one can't be), Back…
- Report builder: Build a chart from your metrics without code: choose metrics, how to group them over time, an optional breakdown, filters, the range and the chart, see…
- Report library: A business's reports in one place. The directory: reports by topic and group with search, each with what it answers; one this person can't open says why…
- Review page builder: Building the page reviewers use to go through records one by one. The queue of records (one with no title shows its id instead of a blank); the record as…
- Workflow builder: Automation rules for a SaaS without code: a trigger, conditions built with the query builder that branch into Yes and No, actions and waits, drawn as a…
- Workflow library: The automation library: every automation as a row (what starts it, whether it's live, a draft or paused, who owns it, when it last ran, and its runs this…
- Drawing board: A whiteboard a team already knows how to use, like FigJam: tools in a floating bar at the bottom (Select V, Hand H, Sticky note S, Shape R/O/D, Connector…
- Model workbench: A CAD model's workbench around a large isometric scene of its bodies, each shaded from its material's appearance with a soft ground shadow and an axis…
- Component properties: A design system component from three sides. Its variants as a matrix on two chosen properties, the others filtering it, each cell drawing the variant; a…
- Slot editor: Slots in a design system component, from making to filling. The main component's layer tree with a checkbox per layer: a nested frame converts to a slot…