Skip to content

Instantly share code, notes, and snippets.

View b-ran's full-sized avatar
:octocat:
working hard on something new

b-ran

:octocat:
working hard on something new
View GitHub Profile
@b-ran
b-ran / Button.svelte
Last active February 12, 2025 09:54
Clean svelte 5 props w/class
<script lang="ts">
import type { Snippet } from 'svelte';
import type { ClassValue } from 'svelte/elements';
const props = $props();
let { children, onclick = undefined, type = undefined }: {
children?: Snippet;
onclick?: () => void;
type?: 'button' | 'submit' | 'reset';