mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-19 03:49:34 +00:00
feat(link): support link with icon
This commit is contained in:
parent
40c07456b4
commit
7e108acead
5 changed files with 48 additions and 10 deletions
|
@ -4614,6 +4614,15 @@
|
|||
"constant": false,
|
||||
"reactive": false
|
||||
},
|
||||
{
|
||||
"name": "icon",
|
||||
"kind": "let",
|
||||
"description": "Specify the icon from `carbon-icons-svelte` to render\n`inline` must be `false`",
|
||||
"type": "typeof import(\"carbon-icons-svelte\").CarbonIcon",
|
||||
"isFunction": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
},
|
||||
{
|
||||
"name": "disabled",
|
||||
"kind": "let",
|
||||
|
|
|
@ -4,6 +4,7 @@ components: ["Link", "OutboundLink"]
|
|||
|
||||
<script>
|
||||
import { Link, OutboundLink } from "carbon-components-svelte";
|
||||
import Carbon16 from "carbon-icons-svelte/lib/Carbon16"
|
||||
import Preview from "../../components/Preview.svelte";
|
||||
</script>
|
||||
|
||||
|
@ -32,6 +33,15 @@ An alternative to manually setting `target` to `"_blank"` is to use the `Outboun
|
|||
<Link inline href="https://www.carbondesignsystem.com/">Carbon Design System</Link>.
|
||||
</div>
|
||||
|
||||
### Link with icon
|
||||
|
||||
Note that `inline` must be `false` when rendering a link with an icon.
|
||||
|
||||
<div>
|
||||
Visit the
|
||||
<Link href="https://www.carbondesignsystem.com/" icon={Carbon16}>Carbon Design System</Link>.
|
||||
</div>
|
||||
|
||||
### Large size
|
||||
|
||||
<Link size="lg" href="https://www.carbondesignsystem.com/">Carbon Design System</Link>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue