carbon-components-svelte/docs/src/pages/components/Link.svx
2020-10-14 15:06:02 -07:00

33 lines
No EOL
998 B
Text

<script>
import { Link } from "carbon-components-svelte";
import Preview from "../../components/Preview.svelte";
</script>
### Default
<Link href="https://www.carbondesignsystem.com/">Carbon Design System</Link>
### Target _blank
Setting `target` to `"_blank"` opens the link in a new tab.
If `target="_blank"`, the `Link` component will automatically set `rel="noopener noreferrer"` to guard against [potential cross-origin security exploits](https://web.dev/external-anchors-use-rel-noopener/).
You can override the `rel` attribute with a custom value.
<Link href="https://www.carbondesignsystem.com/" target="_blank">Carbon Design System</Link>
### Inline variant
<div>
Visit the
<Link inline href="https://www.carbondesignsystem.com/">Carbon Design System</Link>.
</div>
### Disabled
<Link disabled href="https://www.carbondesignsystem.com/">Carbon Design System</Link>
### Visited styles
<Link visited href="https://www.carbondesignsystem.com/">Carbon Design System</Link>