From 90ea699848fc439a259d66524181c9954f59e15d Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sat, 3 May 2025 09:18:09 -0700 Subject: [PATCH] docs(form): improve docs --- docs/src/pages/components/Form.svx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/src/pages/components/Form.svx b/docs/src/pages/components/Form.svx index 4989c5dd..a0db291b 100644 --- a/docs/src/pages/components/Form.svx +++ b/docs/src/pages/components/Form.svx @@ -14,8 +14,15 @@ components: ["Form", "FormGroup"] import Preview from "../../components/Preview.svelte"; +The `Form` component provides a structured way to collect user input. It works with +various form controls like checkboxes, radio buttons, and select menus. The +`FormGroup` component helps organize related form controls with a legend. + ## Form +Create a form with grouped controls using `Form` and `FormGroup`. This example +shows a form with checkboxes, radio buttons, and a select menu. +
@@ -63,7 +70,9 @@ components: ["Form", "FormGroup"] ## Prevent default behavior -The forwarded `submit` event is not modified. Use `e.preventDefault()` to prevent the native form submission behavior. +Handle form submission by preventing the default browser behavior. Use +`e.preventDefault()` to stop the native form submission and handle the event +programmatically. { e.preventDefault();