Skip to main content

Form

Wraps one or more form controls and enables implicit submission, letting users submit the form from any input by pressing “Enter.” Unlike the HTML form element, this component doesn’t automatically submit data via HTTP. You must register a submit event to handle form submission in JavaScript.

Learn more about registering events.

<typeof tagName> | null

A callback that is run when the form is reset.

<typeof tagName> | null

A callback that is run when the form is submitted.

Was this section helpful?
<s-form>
<s-text-field label="Email address" />
<s-button variant="primary" accessibilityRole="submit">Submit</s-button>
</s-form>

Preview