13 of 16
Navigate with links, act with buttons
If activating a control takes someone to another URL, make it a link with an href, however it is styled. The browser then offers Open in new tab and Copy link, and shows the address before the click. Keep buttons for actions that change something on the current page.
Do<a href="/invoices/1042">View invoice</a>
Don’t<div onClick={() => router.push(…)}>
Before you ship
- Right-click the control. Does the menu offer Open link in new tab and Copy link address?
- Hover the control, then Cmd-click or middle-click it. Does the status bar show the destination, and does a new tab open while this page stays where it was?
- Does anything styled as a button change the URL, or anything styled as a link only change the current page?