svelte-5-ui-lib
Version:
Svelte 5 UI Lib is a UI library built from scratch to leverage Svelte 5's runes system, creating smooth, reactive components.
34 lines (33 loc) • 1.48 kB
TypeScript
import type { Snippet } from 'svelte';
import type { HTMLButtonAttributes, HTMLAnchorAttributes } from 'svelte/elements';
type ButtonColorType = 'primary' | 'dark' | 'alternative' | 'light' | 'secondary' | 'gray' | 'red' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'emerald' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose';
type ButtonSizeType = 'sm' | 'md' | 'lg' | 'xl' | 'xs' | undefined;
type HTMLAttributesWithoutAbort = Omit<HTMLButtonAttributes, 'on:abort'> & Omit<HTMLAnchorAttributes, 'on:abort'>;
interface ButtonProps extends HTMLAttributesWithoutAbort {
children: Snippet;
pill?: boolean;
outline?: boolean;
size?: ButtonSizeType;
color?: ButtonColorType;
shadow?: boolean;
tag?: string;
checked?: boolean;
class?: string;
disabled?: boolean;
href?: string;
}
type GradientButtonColorType = 'red' | 'lime' | 'green' | 'teal' | 'cyan' | 'blue' | 'purple' | 'pink' | 'purpleToBlue' | 'cyanToBlue' | 'greenToBlue' | 'purpleToPink' | 'pinkToOrange' | 'tealToLime' | 'redToYellow' | undefined;
interface GradientButtonProps extends HTMLAttributesWithoutAbort {
children: Snippet;
pill?: boolean;
outline?: boolean;
size?: ButtonSizeType;
color?: GradientButtonColorType;
shadow?: boolean;
tag?: string;
checked?: boolean;
class?: string;
disabled?: boolean;
href?: string;
}
export { type ButtonProps, type GradientButtonProps };