Could not find in the docs what type I should when typing the props interface when building for example a button for our projects component library
Describe the proposed solution
As an inexperienced typescript developer you should be guided in the docs to use types from svelte/elements module, so you don't fall into the trap of typing out all attributes yourself
A simple example would be something like this
Button.svelte
<script lang="ts">
import { type HTMLButtonAttributes } from "svelte/elements"
interface props extends HTMLButtonAttributes {
/* place your stuff here */
}
let { ...restProps }: props = $props()
</script>
<button {...restProps}></button>
Describe the problem
Could not find in the docs what type I should when typing the props interface when building for example a button for our projects component library
Describe the proposed solution
As an inexperienced typescript developer you should be guided in the docs to use types from
svelte/elements
module, so you don't fall into the trap of typing out all attributes yourselfA simple example would be something like this
Button.svelte
A community member suggested to add svelte-elements.md in https://github.com/sveltejs/svelte/tree/main/documentation/docs/98-reference
Importance
would make my life easier