Code snippet, better UX in questionnaire
This commit is contained in:
@@ -6,15 +6,24 @@
|
||||
export let name = "";
|
||||
export let type;
|
||||
export let variant = VARIANTS.CONTAINED;
|
||||
export let disablePadding = false;
|
||||
export let isDisabled = false;
|
||||
|
||||
const variantClass = VARIANTS_CLASS[variant];
|
||||
</script>
|
||||
|
||||
<button
|
||||
class="h-auto {variantClass} py-1 px-3 rounded {className} transition delay-150 duration-300 ease-in-out"
|
||||
class="{isDisabled &&
|
||||
'bg-opacity-25 hover:bg-opacity-25 cursor-not-allowed'} flex items-center h-auto {variantClass} {!disablePadding &&
|
||||
'py-1 px-5'} rounded {className} transition delay-150 duration-300 ease-in-out "
|
||||
on:click={onClick}
|
||||
{name}
|
||||
{type}
|
||||
disabled={isDisabled}
|
||||
>
|
||||
{label}
|
||||
{#if label}
|
||||
{label}
|
||||
{:else}
|
||||
<slot />
|
||||
{/if}
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user