Skip to main content

Form Fields

ActionButton.Remote can render generated fields by passing a schema. This keeps actions on SvelteKit remote forms while still supporting user input.

Basic Usage

<script lang="ts">
import { ActionButton } from '@repo/actions'
import { importEmployeesForm } from '$lib/domains/employees/database/employees.remote'
import { importEmployeesSchema } from '$lib/domains/employees/utils/schemas'
</script>

<ActionButton.Root>
<ActionButton.Item>
<ActionButton.Remote label="Import Employees" form={importEmployeesForm} schema={importEmployeesSchema} />
</ActionButton.Item>
</ActionButton.Root>

Props

PropTypeDescription
labelstring | SnippetTrigger text or snippet
titlestringOptional override for dialog title
formRemoteFormRemote form from a *.remote.ts file
schemaZod schemaOptional schema for generated fields
childrenSnippetOptional custom content

All additional props are forwarded to TypedForm.Remote from @repo/form.

Behavior

  • Renders generated fields when schema is provided
  • On success: closes dialog and shows toast notification
  • Renders "OK" and "Close" buttons automatically