diff --git a/src/Button/Button.svelte b/src/Button/Button.svelte
index 3f552730..8954b1b3 100644
--- a/src/Button/Button.svelte
+++ b/src/Button/Button.svelte
@@ -25,6 +25,11 @@
*/
export let isSelected = false;
+ /**
+ * Set to `true` for the icon-only variant
+ */
+ export let iconOnly = false;
+
/**
* Specify the icon to render
* @type {typeof import("svelte").SvelteComponent}
@@ -85,7 +90,7 @@
$: if (ctx && ref) {
ctx.declareRef(ref);
}
- $: hasIconOnly = icon && !$$slots.default;
+ $: hasIconOnly = iconOnly || (icon && !$$slots.default);
$: buttonProps = {
type: href && !disabled ? undefined : type,
tabindex,
@@ -152,8 +157,10 @@
>
{#if hasIconOnly}
{iconDescription}
+ {:else}
+
{/if}
-
{#if hasIconOnly}
{iconDescription}
+ {:else}
+
{/if}
-