Darren Xu Blog

Buttons vs links


We often mix up buttons and links because both are clickable and both can change the page. That confusion is bad for accessibility, for expectations, and for the browser behaviours users rely on.

This is why it matters:

Buttons should trigger actions

A button is an action control. It should do work inside the page or app:

If the element is doing something, it should be a button.

Examples:

Buttons can also change the page, but only as a result of an action.

A link is a navigational control. It should take the user to a location:

If the element moves focus or changes the URL intentionally, a link is usually the right choice.

Examples:

Scroll-to-section / anchor navigation

Going to a section or scrolling to the top is also navigation.

Use an anchor or link for this, not a button, when the intent is to move the user through content.

Create-and-navigate

A common pattern is “create, then navigate”.

For example:

This pattern I am currently trying to figure out the best solution.

I have found guidance saying that it should usually stay a button, because the interaction is not just navigation. The click triggers a create action first, then navigation is a consequence. However, I can also think of scenarios where you would want the link behaviour.

Why the distinction matters

Accessibility

Screen readers expose roles and context from HTML elements.

If something looks like a link but acts like a button, users may hesitate or be confused.

Interaction expectations

Links can be opened in a new tab, copied, or shared. Buttons cannot.

If your control is expected to navigate, it should be link-marked. If it is expected to take an action, it should be button-marked.

Keyboard and focus

Buttons can be activated with space/enter, and links with enter.

A hidden navigation action disguised as a button can disrupt this expected keyboard flow.

When you need to do both

Sometimes an interaction feels like both navigation and action.

Ask:

If the first result is navigation, use a link. If the first result is an action with optional follow-up navigation, use a button.

Example: create then go to the newly created page

This is a button because the primary interaction is creation. Navigation is a side effect.

Example: open a page with a parameter-changing action

If the user is simply choosing a destination, a link is better.

Special cases

<a download> is a link with specific semantics.

It is still navigation, because it targets a resource. Don’t make it a button just because it triggers a download.

These are still links when the intent is resource access or location change.

Buttons that navigate within a single-page app

In a SPA, clicking a button may perform state management and then update the route.

Even then, it should remain a button if the route update is a result of the action.

Practical guidance

Summary

Buttons need to do something. Links need to take you somewhere.

That simple rule keeps interactions predictable, accessible, and easier to maintain.

When in doubt, think about the end state: is the user trying to act, or trying to move?