diff --git a/src/lib/components/form/Button.svelte b/src/lib/components/form/Button.svelte index d239295..1966bdd 100644 --- a/src/lib/components/form/Button.svelte +++ b/src/lib/components/form/Button.svelte @@ -38,6 +38,15 @@ /** Additional classes to insert */ extraclass?: string; + + /** An optional onclick event for the button */ + onclick?: (event: Event) => void; + + /** An optional formaction for the button */ + formaction?: string; + + /** Optionally disable the button */ + disabled?: boolean; } let { @@ -51,6 +60,9 @@ trigger_popup = { event: "click", target: "invalid" }, shadow = false, extraclass = "", + onclick = () => {}, + formaction = undefined, + disabled = false, ...restProps }: ButtonProps = $props(); @@ -63,8 +75,11 @@ : ''} {activate_href && is_at_path(href) ? 'btn-hover' : ''} {shadow ? 'shadow' : ''} {extraclass}" - {...restProps}>{@render children()} + {@render children()} + {:else} + {@render children()} + {/if}