feat(search): allow custom search icon

Allows consumers to render a different Carbon icon instead of the default Search16 icon.
This commit is contained in:
Eric Y Liu 2021-06-26 06:07:23 -07:00
commit b4664507c5
5 changed files with 46 additions and 20 deletions

View file

@ -7939,6 +7939,15 @@
"constant": false,
"reactive": false
},
{
"name": "icon",
"kind": "let",
"description": "Specify the icon from `carbon-icons-svelte` to render",
"type": "typeof import(\"carbon-icons-svelte\").CarbonIcon",
"isFunction": false,
"constant": false,
"reactive": false
},
{
"name": "id",
"kind": "let",

View file

@ -1,4 +1,5 @@
<script>
import Query16 from "carbon-icons-svelte/lib/Query16";
import { Search } from "carbon-components-svelte";
import Preview from "../../components/Preview.svelte";
</script>
@ -43,6 +44,10 @@ The "clear" event is dispatched when clicking the "X" button in the search input
<Search disabled />
### Custom search icon
<Search icon={Query16} />
### Skeleton
<Search skeleton />