Lemma Record Form
lemma/lemma-record-formFreeBlock
A schema-aware record form with searchable FK inputs, enum/type-aware controls, conditional field visibility, and inline/modal/sheet layouts. Supports direct or function-backed submissions.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/lemma-work/lemma-platform/main/lemma-typescript/public/r/lemma-record-form.jsonSource
1"use client"23import * as React from "react"4import { Loader2 } from "lucide-react"5import { Button } from "@/components/lemma/ui/button"6import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@/components/lemma/ui/dialog"7import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "@/components/lemma/ui/sheet"8import { Separator } from "@/components/lemma/ui/separator"9import { useRecordForm } from "lemma-sdk/react"10import {11 DEFAULT_RECORD_FORM_HIDDEN_FIELDS,12 orderRecordSchemaFields,13 type LemmaClient,14} from "lemma-sdk"15import { RecordFormField } from "@/components/lemma/record-form-fields"16import { cn } from "@/components/lemma/lib/utils"1718export type LemmaRecordFormAppearance = "default" | "minimal" | "borderless" | "contained"19export type LemmaRecordFormSurface = "inherit" | "muted" | "card"20export type LemmaRecordFormDensity = "compact" | "comfortable" | "spacious"21export type LemmaRecordFormRadius = "none" | "sm" | "md" | "lg" | "xl"22export type LemmaRecordFormVisibilityRule<TContext> = boolean | ((context: TContext) => boolean)2324export interface LemmaRecordFormFieldVisibilityContext {25 values: Record<string, unknown>26 fieldName: string27}2829export interface LemmaRecordFormSectionVisibilityContext {30 values: Record<string, unknown>31 label: string32 fields: string[]33}3435export interface LemmaRecordFormFieldGroup {36 label: string37 fields: string[]38 visible?: LemmaRecordFormVisibilityRule<LemmaRecordFormSectionVisibilityContext>39}4041export interface LemmaRecordFormProps {42 client: LemmaClient43 podId?: string44 tableName: string45 recordId?: string4647 mode?: "inline" | "modal" | "sheet"48 surface?: LemmaRecordFormSurface49 appearance?: LemmaRecordFormAppearance50 density?: LemmaRecordFormDensity51 radius?: LemmaRecordFormRadius52 submitVia?: "direct" | "function"53 submitFunctionName?: string54 submitFunctionInput?: (payload: Record<string, unknown>) => Record<string, unknown>55 hiddenFields?: string[]56 visibleFields?: string[]57 fieldOrder?: string[]58 fieldGroups?: LemmaRecordFormFieldGroup[]59 fieldVisibility?: Record<string, LemmaRecordFormVisibilityRule<LemmaRecordFormFieldVisibilityContext>>60 sectionVisibility?: Record<string, LemmaRecordFormVisibilityRule<LemmaRecordFormSectionVisibilityContext>>61 foreignKeyLabels?: Record<string, string>6263 initialValues?: Record<string, unknown>64 onSuccess?: (record: Record<string, unknown>) => void65 onClose?: () => void66}6768// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from lemma
All 20 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Lemma Action Surfacelemma-action-surface | lemma | Blocks | Free | 4 deps | |
| Lemma Activity Feedlemma-activity-feed | lemma | Blocks | Free | 4 deps · 3 files | |
| Lemma Agent Conversation Experiencelemma-assistant-experience | lemma | Blocks | Free | 7 deps · 3 files | |
| Lemma Breadcrumbslemma-breadcrumbs | lemma | Blocks | Free | 3 deps | |
| Lemma Commentslemma-comments | lemma | Blocks | Free | 4 deps · 3 files | |
| Lemma Detail Panellemma-detail-panel | lemma | Blocks | Free | 4 deps · 7 files | |
| Lemma Document Workspacelemma-document-workspace | lemma | Blocks | Free | 6 deps | |
| Lemma File Browserlemma-file-browser | lemma | Blocks | Free | 4 deps |
