Post

Do you author web components with "required" attributes? The convention for most HTML elements is that no attributes are required. But in the context of a design system, it would be nice to require configuration for a custom element. Like a variant attribute for a badge or a button.

I didn't think too much about this until configuring the types for a web component to be used in React. When I made certain attributes required, I realized that no other elements require HTML attributes, and never provide type errors.

0 reposts2 likes

No replies yet.