mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
40 lines
702 B
Svelte
40 lines
702 B
Svelte
<script>
|
|
/**
|
|
* Specify the `href` attribute
|
|
* @type {string} [href]
|
|
*/
|
|
export let href = undefined;
|
|
|
|
/**
|
|
* Specify the text
|
|
* @type {string} [text]
|
|
*/
|
|
export let text = undefined;
|
|
|
|
/**
|
|
* Obtain a reference to the HTML anchor element
|
|
* @type {null | HTMLAnchorElement} [ref=null]
|
|
*/
|
|
export let ref = null;
|
|
</script>
|
|
|
|
<li>
|
|
<a
|
|
bind:this="{ref}"
|
|
role="menuitem"
|
|
tabindex="0"
|
|
href="{href}"
|
|
class:bx--header__menu-item="{true}"
|
|
{...$$restProps}
|
|
on:click
|
|
on:mouseover
|
|
on:mouseenter
|
|
on:mouseleave
|
|
on:keyup
|
|
on:keydown
|
|
on:focus
|
|
on:blur
|
|
>
|
|
<span class:bx--text-truncate--end="{true}">{text}</span>
|
|
</a>
|
|
</li>
|