We have Custom Elements, but do we also need Custom Attributes?
@FirefoxWebDevs90K followers
23,810 views
11 Comments
Comments from the original post on X (Twitter)

@FirefoxWebDevs
More details about the proposal on GitHub
9 likes

@filearts
This reminds me a lot of AngularJS directives. These were tricky but powerful tools for composable behavior. They were used sparingly but couldn't be replicated with other APIs. Could the hypothetical API allow a my-for attribute that manages a set of cloned instances?
4 likes

@FireNeslo
Yes finally we can add the mythical customAttributes.define('is', CustomElementExtendsAttribute)
4 likes

@JLarky
I'm glad to see that web components hype died down enough for standalone features like scoped css and custom attributes to finally get some attention!
4 likes

@olaf_k
@jaffathecake I’d argue custom attributes would be far more powerful than custom elements!
1 like

@kettanaito
Not sure I like the idea of a custom attribute mutating a built-in HTML element. That obscures the discovery of that custom behavior or even makes it impossible if your custom attribute it set programmatically/dynamically. Not sure what problem custom attrs solve.
1 like

@MrFlashAccount
Are you discussing things like accessing popover/dialog API without using corresponding attributes/tags?
1 like

@RobbieSpeed
Yes, want very much, but do not want them to override or create any accessors and methods on assigned elements. That stuff should all live on the attribute node itself.

@victorgbaye
I’m not sure this is a great idea, think browser compatibility and accessibility.

@prav33n
Would be definitely useful for custom elements. 👍 Not sure about all elements - sounds like a can of worms.

@siematos
I like the idea of encoding more in HTML. But please don't go the CustomElements/ShadowDOM route. Think about how to define and register behavior declaratively first please. At a minimum, this involves integration into CSS queries/selectors in a <noscript>/lynx environment.