Fejlesztőknek
Kezdj bele
Témák/Theme SDK/Modules/forms/Types: StoreFormProps to ContactFormProps

Types: StoreFormProps to ContactFormProps

Ez az oldal még csak angolul érhető el.

The types of @poltura/theme-sdk/forms, StoreFormProps to ContactFormProps.

Ezen az oldalon
import { … } from '@poltura/theme-sdk/forms';

StoreFormProps

Props of StoreForm.

handlerequiredstring

The handle of the published form, such as `contact`.

childrenReactNode

Your own fields and buttons; the form's fields and send button when omitted.

layoutStoreFormLayout

How the fields sit.

appearanceStoreFormAppearance

The surface the form draws on.

chromeStoreFormChrome

Whether the title and card draw; `full` when omitted.

copyStoreFormCopy

The theme's own wording.

fieldVisibilityReadonly<Record<string, boolean>>

Fields to hide or show by field id, over the merchant's settings.

emailHintsboolean

Shows deliverability hints under email fields; a domain that takes no mail blocks sending.

onAccepted(submissionId: string, preview: boolean) => void

Called once the store accepted a submission; `preview` is true in the customizer.

classNamestring

Classes added to the form's card.

FormFieldRender

What a FormField render function receives.

fieldrequiredStoreFormFieldView

The field.

valuerequiredFormValue

The field's value.

errorrequiredstring | null

The field's error, or null.

describedByrequiredstring

The id of the error line, for `aria-describedby`.

setValuerequired(value: FormValue) => void

Sets the field's value.

FormFieldProps

Props of FormField.

idrequiredstring

The field id.

children(field: FormFieldRender) => ReactNode

Draws your own control; the platform control when omitted.

FieldControlProps

Props of FieldControl.

fieldrequiredStoreFormFieldView

The field to draw.

valuerequiredFormValue

The field's value.

errorstring | null

The error to show, or null.

disabledboolean

Whether the control is disabled.

onChangerequired(value: FormValue) => void

Called with the new value.

SubmitButtonProps

Props of SubmitButton.

childrenReactNode

The label; the form's send or next-step wording when omitted.

classNamestring

Classes added to the button.

FormDisplay

Whether a form opens as a dialog or as a side panel.

type FormDisplay = 'popup' | 'drawer'

FormWidth

How wide an opened form is.

type FormWidth = 'compact' | 'standard' | 'wide'

OpenFormInput

A form to open in a dialog or side panel.

handlerequiredstring

The handle of the published form.

displayFormDisplay

Dialog or side panel; `popup` when omitted.

widthFormWidth

How wide it opens; `standard` when omitted.

layoutStoreFormLayout

How the fields sit.

appearanceStoreFormAppearance

The surface the form draws on.

FormActions

The actions that open a published form over the page.

openFormrequired(input: OpenFormInput, trigger?: HTMLElement | null) => void

Opens the form; focus returns to `trigger` when it closes.

preloadFormrequired(handle: string) => void

Starts loading a form, so it opens without a wait.

FormTriggerProps

Props of FormTrigger.

handlerequiredstring

The handle of the published form.

displayFormDisplay

Dialog or side panel; `popup` when omitted.

widthFormWidth

How wide it opens; `standard` when omitted.

layoutStoreFormLayout

How the fields sit.

appearanceStoreFormAppearance

The surface the form draws on.

childrenReactNode

The button label.

classNamestring

Classes added to the button.

FormPopupFrequency

How often a form that opens by itself opens again for one visitor: once ever, once a session, or after 30 days.

type FormPopupFrequency = 'once' | 'session' | 'days'

FormPopupProps

Props of FormPopup.

handlerequiredstring

The handle of the published form.

displayFormDisplay

Dialog or side panel; `popup` when omitted.

widthFormWidth

How wide it opens; `standard` when omitted.

layoutStoreFormLayout

How the fields sit.

appearanceStoreFormAppearance

The surface the form draws on.

delaySecondsrequirednumber

Seconds after the page opens before the form does; at least 5.

frequencyrequiredFormPopupFrequency

How often it opens again for the same visitor.

NewsletterTexts

The newsletter wording, from the theme settings over the platform's own, and the store's consent sentence.

headingrequiredstring

The heading.

descriptionrequiredstring

The line under the heading.

buttonrequiredstring

The sign-up button.

consentrequiredstring

The store's marketing consent sentence; theme settings do not change it.

NewsletterState

Whether the store takes newsletter sign-ups, and the wording to ask with.

enabledrequiredboolean

Whether the store collects newsletter sign-ups.

visiblerequiredboolean

Whether the theme shows the newsletter; false when the merchant switched it off in the theme.

doubleOptInrequiredboolean

Whether a sign-up must confirm by email before it counts.

formHandlerequiredstring

The handle of the newsletter form.

textsrequiredNewsletterTexts

The wording in the page language.

NewsletterLayout

Where a newsletter form sits, which decides its look.

type NewsletterLayout = 'inline' | 'stacked' | 'footer' | 'section'

NewsletterFormProps

Props of NewsletterForm.

layoutNewsletterLayout

`inline` and `stacked` draw the form alone; `footer` adds the footer heading, `section` a full-width band.

appearanceStoreFormAppearance

The surface the form draws on, for `inline` and `stacked`.

chromeStoreFormChrome

Whether the title and card draw, for `inline` and `stacked`.

copyStoreFormCopy

The theme's own wording, for `inline` and `stacked`.

onAccepted(submissionId: string, preview: boolean) => void

Called once a sign-up was accepted; `preview` is true in the customizer.

classNamestring

Classes added to the form.

NewsletterTriggerProps

Props of NewsletterTrigger.

displayFormDisplay

Dialog or side panel; `popup` when omitted.

widthFormWidth

How wide it opens.

childrenReactNode

The button label.

classNamestring

Classes added to the button.

ContactFormProps

Props of ContactForm; every wording falls back to the platform's own.

formTitlestring

The form title.

formSubtitlestring

The line under the title.

showNameboolean

Whether the name field shows; true when omitted.

showSubjectboolean

Whether the subject field shows; true when omitted.

nameLabelstring

The name label.

namePlaceholderstring

The name placeholder.

emailLabelstring

The email label.

emailPlaceholderstring

The email placeholder.

subjectLabelstring

The subject label.

subjectPlaceholderstring

The subject placeholder.

messageLabelstring

The message label.

messagePlaceholderstring

The message placeholder.

submitLabelstring

The send button.

successTitlestring

The heading after sending.

successMessagestring

The message after sending.

newMessageLabelstring

The button that starts a new message.

Utoljára frissítve