smrt
Open the smrt source on GitHub Switch to dark color scheme
← All UI components

Forms and controls

Form

The Provider-free base `<form>` primitive.

Public export

typescript
import { Form } from '@happyvertical/smrt-ui/forms';
Import path
@happyvertical/smrt-ui/forms
Props
8
Props described
8 of 8
Bindable state
0
Callback events
1
Verified release
0.70.2

Props

Also accepts Omit<HTMLFormAttributes, 'class'>. The table lists the component-specific contract.

NameTypeRequiredDescription
classstringNoCSS class to apply to the form element.
preventDefaultbooleanNoWhether to prevent default form submission behavior.
formIdstringNoStable form scope used by voice/chat/tutorial adapters.
interactionRegistryControlInteractionRegistryNoSupply a registry to coordinate multiple forms or inspect commands.
oninteraction(event: ControlInteractionEvent) => voidNoReceives registry lifecycle and command events.
stagedReviewbooleanNoRender the built-in human review surface for staged changes.
validatebooleanNoOpt in to validate-before-submit (#5346): each invalid field shows its reason next to it once touched or after a submit attempt, and submit is blocked until the form is valid. Never takes over the POST; pair with `preventDefault={false}` for a native/SvelteKit form-action submit.
childrenSnippetYesForm controls and content inside the form.

Bindable state

This component has no bindable public state.

Callback events

  • oninteraction(event: ControlInteractionEvent) => void

Examples and explanation