mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
39 lines
682 B
Svelte
39 lines
682 B
Svelte
<script>
|
|
/**
|
|
* Set the `href` to use an anchor link
|
|
* @type {string} [href]
|
|
*/
|
|
export let href = undefined;
|
|
|
|
/**
|
|
* Set to `true` to use the small variant
|
|
* @type {boolean} [small=false]
|
|
*/
|
|
export let small = false;
|
|
</script>
|
|
|
|
{#if href}
|
|
<a
|
|
{href}
|
|
role="button"
|
|
class:bx--skeleton={true}
|
|
class:bx--btn={true}
|
|
class:bx--btn--sm={small}
|
|
{...$$restProps}
|
|
on:click
|
|
on:mouseover
|
|
on:mouseenter
|
|
on:mouseleave>
|
|
{''}
|
|
</a>
|
|
{:else}
|
|
<div
|
|
class:bx--skeleton={true}
|
|
class:bx--btn={true}
|
|
class:bx--btn--sm={small}
|
|
{...$$restProps}
|
|
on:click
|
|
on:mouseover
|
|
on:mouseenter
|
|
on:mouseleave />
|
|
{/if}
|