simple guidelines on when to use button vs link


Use a link when changing url 

  • e.g. navigate somewhere such nav one page to another
  • e.g. nav to anchors on the same page (which change the url)


Use a button when it's a in page action that does not change url

  • e.g. open a modal...unless modal opened as navigation in which case is a link


But we can also submit forms and stay on the page. In which case should use input type submit to submit a form.


"if you can throw away the css and the page still works then probably good for accessibility"


references

https://a11y-101.com/design/button-vs-link


Comments

Popular posts from this blog

angular js protractor e2e cheatsheet

angularjs ui-router query string parameter support

Notes on interview with Kent Beck about AI and why it's like a "genie"