diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index 52f20a6f..52f127a8 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -3464,6 +3464,7 @@ import { Search } from "carbon-components-svelte"; | size | "sm" | "lg" | -- | | skeleton | boolean | false | | light | boolean | false | +| disabled | boolean | false | | value | string | "" | | type | string | "text" | | placeholder | string | "Search..." | diff --git a/docs/src/pages/components/Search.svx b/docs/src/pages/components/Search.svx index 7649671e..8a10cf35 100644 --- a/docs/src/pages/components/Search.svx +++ b/docs/src/pages/components/Search.svx @@ -23,6 +23,10 @@ +### Disabled + + + ### Skeleton \ No newline at end of file diff --git a/src/Search/Search.svelte b/src/Search/Search.svelte index 7450d01f..86db4f5d 100644 --- a/src/Search/Search.svelte +++ b/src/Search/Search.svelte @@ -23,6 +23,12 @@ */ export let light = false; + /** + * Set to `true` to disable the search input + * @type {boolean} [disabled=false] + */ + export let disabled = false; + /** * Specify the value of the search input * @type {string} [value="text"] @@ -96,6 +102,7 @@
@@ -108,6 +115,7 @@ class:bx--search-input="{true}" autofocus="{autofocus}" autocomplete="{autocomplete}" + disabled="{disabled}" id="{id}" placeholder="{placeholder}" type="{type}" @@ -121,6 +129,7 @@