Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
757 B · 32 lines
Svelte
at main
123456789101112131415161718192021222324252627282930313233<script lang="ts"> import type { Snippet } from 'svelte'; import type { HTMLButtonAttributes } from 'svelte/elements'; import styles from './Button.module.css';
type Props = Omit<HTMLButtonAttributes, 'children' | 'class' | 'type'> & { children: Snippet; class?: string; fullWidth?: boolean; size?: 'small' | 'medium' | 'large'; type?: 'button' | 'submit' | 'reset'; variant?: 'primary' | 'secondary' | 'ghost'; };
let { children, class: className, fullWidth = false, size = 'medium', type = 'button', variant = 'primary', ...rest }: Props = $props();</script>
<button {type} class={[styles.button, styles[variant], styles[size], fullWidth && styles.fullWidth, className]} {...rest}> {@render children()}</button>