s-m-r-t
Open the s-m-r-t source on GitHub Switch to dark color scheme
← All UI components

Fields · Components

ObjectForm

No summary has been written for ObjectForm. Everything below is generated from the declaration shipped in 0.44.0 and describes the real contract.

Public export

typescript
import { ObjectForm } from '@happyvertical/smrt-fields/svelte';
Import path
@happyvertical/smrt-fields/svelte
Props
15
Props described
15 of 15
Bindable state
1
Callback events
1
Verified release
0.44.0

Props

NameTypeRequiredDescription
objectRefstringYesIdentifier for the object being edited.
fieldsReadonly<Record<string, ObjectFormFieldDefinition>>NoGenerated browser-safe definitions — never pass raw server registry fields. Omit with `policy` to resolve both through ObjectFormSourceProvider.
policyResolvedObjectFieldPolicyNoPre-resolved policy for the same objectRef. Omit with `fields` for a source.
valueRecord<string, unknown>NoMutable create/edit record. Bind this prop to retain values in the host.
isNewRecordbooleanNoTrue for creates (defaults may prefill), false for loaded edits.
createSessionKeystring | numberNoOptional identity for a create session. Change this when reusing a mounted form for another new record; defaults then apply once to missing values. With no key, replacing the bound record with an empty object starts a new create session automatically.
disabledbooleanNoBlocks form input and submission.
showModeSwitchbooleanNoShows the mode toggle between basic and advanced fields.
showPolicyGearbooleanNoRender a provider-registered policy gear next to the mode control.
inputRegistryFieldInputRegistryNoOptional registry of custom field input components.
renderersReadonly<Record<string, Snippet<[ObjectFormFieldSnippetProps]>>>NoPer-field custom widget snippets, keyed by field name.
actionsSnippetNoOptional controls rendered after the policy-ordered fields inside the form.
usageReporterFieldUsageReporterNoOptional telemetry transport. It runs only when `onsubmit` explicitly resolves `true` after persistence; identity and field sensitivity remain server-derived.
classstringNoCSS class forwarded to the form element.
onsubmitObjectFormSubmitHandlerNoReturn true only after the host has persisted this record successfully.

Bindable state

  • bind:valueRecord<string, unknown>

Callback events

  • onsubmitObjectFormSubmitHandler

Examples and explanation