diff --git a/docs/src/pages/components/Search.svx b/docs/src/pages/components/Search.svx index 4bac0252..ac422836 100644 --- a/docs/src/pages/components/Search.svx +++ b/docs/src/pages/components/Search.svx @@ -4,54 +4,72 @@ import Preview from "../../components/Preview.svelte"; +`Search` provides a flexible search input component with support for expandable variants, different sizes, and custom icons. It includes built-in functionality for clearing input and handling keyboard events. + ## Default -The `Search` component size is extra-large by default. There are [large](#large-size) and [small](#small-size) size variants. +The search component is extra-large by default. Use the `size` prop to choose between [large](#large-size) and [small](#small-size) variants. ## Default value +Set an initial value using the `value` prop. + ## Reactive example +Bind to the `value` prop for reactive updates. + -## on:clear +## Clear event -The "clear" event is dispatched when clicking the "X" button or when pressing the "Escape" key. +The `clear` event is dispatched when clicking the clear button or pressing the Escape key. console.log('clear')}/> ## Expandable variant -Set `expandable` to `true` to use the expandable variant. +Enable the expandable variant to show a compact search icon that expands on focus. ## Light variant +Use the light variant for light backgrounds. + ## Large size +Set `size` to `"lg"` for a large search input. + ## Small size +Set `size` to `"sm"` for a small search input. + ## Disabled state +Disable the search input using the `disabled` prop. + -## Custom search icon +## Custom icon + +Replace the default search icon with a custom one. ## Skeleton +Display a loading state using the skeleton variant. + ## Skeleton (large)