-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Description
Describe the problem
Right now, if I have a component with class prop:
<script>
const { class: className }: {class: string} = $props()
</script>Usage:
<Comp class="py-2 sm-6" />This works beautifully. However, with the new clsx-style classes, we should be able to type the class prop as ClassValue, basically everything that clsx supports
Describe the proposed solution
Export the ClassValue: export type ClassValue = clsx.ClassValue in svelte module, used as
import type { ClassValue } from 'svelte';
const {class: className}: { class: ClassValue[] } = $props();Listed here: https://github.com/lukeed/clsx/blob/master/clsx.d.ts#L2
Importance
nice to have
frederikhors and thes01ndri
Metadata
Metadata
Assignees
Labels
No labels