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.
26 lines (25 loc) • 807 B
TypeScript
import type { Snippet } from 'svelte';
import type { HTMLSelectAttributes, HTMLAttributes } from 'svelte/elements';
type SelectSize = 'sm' | 'md' | 'lg';
type SelectOptionType<T> = {
name: string | number;
value: T;
};
interface SelectProps<T> extends Omit<HTMLSelectAttributes, 'size'> {
children?: Snippet;
items?: SelectOptionType<T>[];
underline?: boolean;
size?: SelectSize;
placeholder?: string;
class?: string;
}
interface MultiSelectProps<T> extends HTMLAttributes<HTMLDivElement> {
children?: Snippet;
items?: SelectOptionType<T>[];
value?: T[];
size?: SelectSize;
dropdownClass?: string;
placeholder?: string;
change?: (event: Event) => void;
}
export { type SelectProps, type SelectOptionType, type MultiSelectProps, type SelectSize };