mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 02:41:05 +00:00
23 lines
469 B
Svelte
23 lines
469 B
Svelte
<script>
|
|
/**
|
|
* Specify the `href` attribute
|
|
* @type {string}
|
|
*/
|
|
export let href = undefined;
|
|
|
|
/** Obtain a reference to the HTML anchor element */
|
|
export let ref = null;
|
|
</script>
|
|
|
|
<li class:bx--switcher__item="{true}">
|
|
<a
|
|
bind:this="{ref}"
|
|
href="{href}"
|
|
rel="{$$restProps.target === '_blank' ? 'noopener noreferrer' : undefined}"
|
|
class:bx--switcher__item-link="{true}"
|
|
{...$$restProps}
|
|
on:click
|
|
>
|
|
<slot />
|
|
</a>
|
|
</li>
|