Skip to content

HTMLSpanAttributes missing from svelte/elements #16014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wighawag opened this issue May 27, 2025 · 2 comments
Closed

HTMLSpanAttributes missing from svelte/elements #16014

wighawag opened this issue May 27, 2025 · 2 comments

Comments

@wighawag
Copy link

wighawag commented May 27, 2025

Describe the bug

I am writing a component that extend the functionality of a <span> element and I was looking to extends the props with the types from svelte/elements but there does not seems to be a type HTMLSpanAttributes

Reproduction

pnpx sv create

create a component

<script lang="ts">
	import { type HTMLSpanAttributes } from 'svelte/elements';
	
	interface Props extends HTMLSpanAttributes {
		msg: string
	}
       let {msg. ...restProps}: Props = $props();
</script>
<span {...restProps}>
{msg}
</span>

Logs

System Info

System:
    OS: Linux 6.12 Pop!_OS 22.04 LTS
    CPU: (16) x64 AMD Ryzen 7 PRO 6850U with Radeon Graphics
    Memory: 11.94 GB / 30.12 GB
    Container: Yes
    Shell: 3.3.1 - /usr/bin/fish
  Binaries:
    Node: 22.15.0 - ~/.volta/tools/image/node/22.15.0/bin/node
    npm: 10.9.2 - ~/.volta/tools/image/node/22.15.0/bin/npm
    pnpm: 10.10.0 - ~/.volta/bin/pnpm
    bun: 1.2.11 - ~/.bun/bin/bun
  Browsers:
    Chrome: 136.0.7103.59

Severity

annoyance

@Conduitry
Copy link
Member

I don't think we expose specific types for elements that just have the standard set of attributes. Would HTMLAttributes<HTMLSpanElement> work for you?

@wighawag
Copy link
Author

Ha, yes, that works, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants