feat: add icon support to Button component

This commit is contained in:
2026-06-09 14:08:53 +02:00
parent 40505bd05e
commit 02ae2b143e
2 changed files with 6 additions and 2 deletions
+3
View File
@@ -34,4 +34,7 @@
background-color: var(--nds-disabled); background-color: var(--nds-disabled);
color: var(--nds-neutral); color: var(--nds-neutral);
} }
&--icon {
padding: var(--nds-spacing-2xs) var(--nds-spacing-xs);
}
} }
+3 -2
View File
@@ -2,11 +2,12 @@
export interface Props { export interface Props {
type: 'primary' | 'secondary'; type: 'primary' | 'secondary';
disabled?: boolean; disabled?: boolean;
icon?: boolean;
} }
const { type, disabled = false } = Astro.props; const { type, disabled = false, icon = false } = Astro.props;
--- ---
<div class={`button button__${type} ${disabled ? 'button--disabled' : ''}`}> <div class={`button button__${type} ${disabled ? 'button--disabled' : ''} ${icon ? 'button--icon' : ''}`}>
<slot/> <slot/>
</div> </div>