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

Commerce · Components

CustomerForm

Props for the native, SSR-safe customer create/edit form.

Public export

typescript
import { CustomerForm } from '@happyvertical/smrt-commerce/svelte';
Import path
@happyvertical/smrt-commerce/svelte
Props
19
Props described
19 of 19
Bindable state
0
Callback events
0
Verified release
0.57.40

Props

NameTypeRequiredDescription
mode'create' | 'edit'NoSelects create or edit copy and identity-lock defaults.
valuesCustomerFormValuesNoExact customer values to render, including server-retained strings.
transportPartyFormTransportNoCaller-owned native form action, method, tokens, and submitter intents.
fieldNamesPartial<CustomerFieldNames>NoHTML field-name overrides used to preserve an existing payload contract.
errorsPartyFormErrorsNoForm, field, and contact errors returned by the server.
labelsPartySurfaceLabelsNoCustomer terminology and action-label overrides.
contactLabelsPartyContactLabelsNoContact terminology overrides.
countryOptionsreadonly CodeSelectOption[]NoCaller-restricted country choices for both addresses.
provinceOptionsreadonly CodeSelectOption[]NoCaller-restricted region choices for both addresses.
readOnlybooleanNoRenders values without mutation affordances.
canSubmitbooleanNoControls whether the save submitter is presented.
canAddContactbooleanNoControls whether the native add-contact submitter is presented.
canRemoveContactbooleanNoControls whether native remove-contact submitters are presented.
lockIdentityKindbooleanNoKeeps an established Profile identity category from being converted.
cancelHrefstringNoCaller-owned URL used by the default cancel action.
extensionPartyExtension<CustomerFormValues>NoConsumer fields rendered before the action bar.
actionsSnippetNoReplaces the default cancel and save action bar.
enhancePartyFormEnhanceNoProgressive-enhancement hook for the native form element, such as SvelteKit's `enhance`. Needed when an `ssr = false` app must not answer a native post with its empty shell.
onsubmitHTMLFormAttributes['onsubmit']NoNative submit handler. Submission stays native unless the handler calls `event.preventDefault()`.

Bindable state

This component has no bindable public state.

Callback events

This component declares no callback event props.

Examples and explanation