Click with a mouse or keyboard to trigger an action. This abstract component is based on the WAI-ARIA Command Role.
npm install ariakit
Learn more in Getting started.
In short, if you need a semantic button element, you should use the Button component.
Button component uses
Command underneath and inherits all its features, but
Button automatically adds the
role="button" attribute when necessary (for example, when rendering a non-native button).
If you need a clickable element with a different semantic role (e.g.,
menuitem), and you're not using the specific Ariakit component (e.g.,
MenuItem), you can use