mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
feat(tag): support custom icon variant
This commit is contained in:
parent
0c8393637a
commit
b2560a21ac
6 changed files with 46 additions and 3 deletions
|
@ -7720,6 +7720,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",
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<script>
|
||||
import { Tag } from "carbon-components-svelte";
|
||||
import IbmCloud16 from "carbon-icons-svelte/lib/IbmCloud16";
|
||||
import Document16 from "carbon-icons-svelte/lib/Document16";
|
||||
import Preview from "../../components/Preview.svelte";
|
||||
</script>
|
||||
|
||||
|
@ -25,6 +27,13 @@
|
|||
|
||||
<Tag filter on:click>Filterable</Tag>
|
||||
|
||||
### Custom icon
|
||||
|
||||
Note: rendering a custom icon cannnot be used with the filterable variant.
|
||||
|
||||
<Tag icon={IbmCloud16}>IBM Cloud</Tag>
|
||||
<Tag icon={Document16} type="blue">API documentation</Tag>
|
||||
|
||||
### Skeleton
|
||||
|
||||
<Tag skeleton />
|
Loading…
Add table
Add a link
Reference in a new issue