DEV Community

Discussion on: Web Development Bad Habits to Kick

ndom91 profile image
Nico Domino

What do you guys think about anchors vs. buttons in SPA navigation.

i.e. if in a todo-list, you hover over the todo and a "view details" link appears. This will take you to a separate page, but still inside that tab / SPA.

Should this be a button or anchor?

aarone4 profile image
Aaron Reese

Look at the user concepts. If it LOOKS like a panel opened in the list (even if the URL changed) then use a button (style). If it looks like a new page use a link style. But most of all, be consistent.