Is there a String Union Type of all HTML Element names?

Pretty much what the title says. I want to be able to pass in any name of an html element, to then apply a style to, and return to the user.
5 Replies
Kyle
Kyle2y ago
so the type would be a string union of something like this:
type Element = "a" | "div" | "p" // and so on and so forth
type Element = "a" | "div" | "p" // and so on and so forth
Kyle
Kyle2y ago
I'm wanting to implement something like this:
Kyle
Kyle2y ago
Answer: HTMLElementTagNameMap
Kyle
Kyle2y ago
Kyle
Kyle2y ago
Lmao Astro has an htmlTag type
Want results from more Discord servers?
Add your server