From 6823abb2e4ad84f4cb9cfb67a55d6e852fc7a111 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sat, 3 May 2025 10:42:09 -0700 Subject: [PATCH] docs(select): improve docs --- docs/src/pages/components/Select.svx | 92 ++++++++++++++++++---------- 1 file changed, 58 insertions(+), 34 deletions(-) diff --git a/docs/src/pages/components/Select.svx b/docs/src/pages/components/Select.svx index 3a619e29..2d56cb4d 100644 --- a/docs/src/pages/components/Select.svx +++ b/docs/src/pages/components/Select.svx @@ -7,9 +7,11 @@ components: ["Select", "SelectItem", "SelectItemGroup", "SelectSkeleton"] import Preview from "../../components/Preview.svelte"; +`Select` provides a dropdown menu for selecting a single option from a list. It supports various states, sizes, and includes built-in validation and helper text. + ## Default -If the `selected` prop is not set, the value of the first `SelectItem` will be used as the default value. +Create a basic select menu with `SelectItem` components. The first item's value is used as the default if `selected` is not set. console.log("value", e.target.value)}> @@ -33,7 +35,7 @@ Use the `text` prop on `SelectItem` to customize the display value. ## Initial selected value -Use the `selected` prop to specify an initial value. +Set the initial selection using the `selected` prop. @@ -61,6 +65,8 @@ The `selected` prop is reactive and supports two-way binding. ## Hidden label +Visually hide the label while maintaining accessibility. +