The Difference Between a Button and a Link
21 hours ago
- The Triptych Project proposes adding 'action' and 'method' attributes to HTML buttons, called Button Actions.
- Links represent destinations that can be re-contextualized (opened in new tab, bookmarked, etc.), while buttons trigger actions in a fixed context without those affordances.
- Buttons are often needed for navigations (e.g., logout, search) but lack the ability to trigger them without being inside a form, leading to the anti-pattern of styling links as buttons.
- Button Actions would allow buttons to navigate to views directly, reusing existing routes and supporting state transitions without JavaScript.
- The proposal addresses common use cases like DELETE requests for comments or likes, improving simplicity, safety, and accessibility.