diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index b36ba07d..6e0bf015 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -1447,7 +1447,9 @@ None. ### Props -None. +| Prop name | Kind | Reactive | Type | Default value | Description | +| :-------- | :--------------- | :------- | :--------------------------------------- | ----------------- | -------------------------------------- | +| ref | let | Yes | null | HTMLFormElement | null | Obtain a reference to the form element | ### Slots diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index 9176f272..f718c1ed 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -3998,7 +3998,19 @@ { "moduleName": "Form", "filePath": "src/Form/Form.svelte", - "props": [], + "props": [ + { + "name": "ref", + "kind": "let", + "description": "Obtain a reference to the form element", + "type": "null | HTMLFormElement", + "value": "null", + "isFunction": false, + "isFunctionDeclaration": false, + "constant": false, + "reactive": true + } + ], "slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }], "events": [ { "type": "forwarded", "name": "click", "element": "form" }, diff --git a/src/Form/Form.svelte b/src/Form/Form.svelte index 5caf1140..502ae9e3 100644 --- a/src/Form/Form.svelte +++ b/src/Form/Form.svelte @@ -1,6 +1,12 @@ + +
- + diff --git a/types/Form/Form.svelte.d.ts b/types/Form/Form.svelte.d.ts index 80e73661..3b5f28bd 100644 --- a/types/Form/Form.svelte.d.ts +++ b/types/Form/Form.svelte.d.ts @@ -2,7 +2,13 @@ import { SvelteComponentTyped } from "svelte"; export interface FormProps - extends svelte.JSX.HTMLAttributes {} + extends svelte.JSX.HTMLAttributes { + /** + * Obtain a reference to the form element + * @default null + */ + ref?: null | HTMLFormElement; +} export default class Form extends SvelteComponentTyped< FormProps,