Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

The LinkS vs. Buttons Showdown by @marcysutton

Slide 3

Slide 3 text

Photo by Matthew Bergman, Cascadia JS

Slide 4

Slide 4 text

Axe-core

Slide 5

Slide 5 text

Axe chrome

Slide 6

Slide 6 text

The Rub Link or Button? http://bit.ly/links-buttons

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

•Navigate to a page or fragment with href •Cause a browser refresh •Deep-link client-rendered applications •Open in new windows with target •Activate with TAB and the Enter key •Show the URL in the status bar Characteristics of Links

Slide 11

Slide 11 text

Get the most out of your links

Slide 12

Slide 12 text

Links in screen readers

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

Search

Slide 15

Slide 15 text

•Submit and reset forms • button, input[type=button] flavors •Trigger UI changes with JavaScript •Operable with TAB and the Space key Characteristics of Buttons

Slide 16

Slide 16 text

Buttons in screen readers

Slide 17

Slide 17 text

•Focusability •Built-in semantics •Keyboard support for click() event listeners •Support for disabled •Submitting of forms Button elements Here’s what you get for free

Slide 18

Slide 18 text

•Dropdown menu triggers •Modal dialog triggers* •Close buttons •Media player controls Common Button Uses

Slide 19

Slide 19 text

“But divs are easier to style”

Slide 20

Slide 20 text

Start here: http://bit.ly/button-CSS

Slide 21

Slide 21 text

Whatever you do, In CSS: •Avoid * { outline: none; } •Discover outline-offset •Apply custom focus styles with :focus

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

Links: Routing & navigation

Slide 24

Slide 24 text

What is navigation?

Slide 25

Slide 25 text

What is routing?

Slide 26

Slide 26 text

Where confusion happens

Slide 27

Slide 27 text

Teamwork tip: It’s confusing to debug when LinksRely On click events

Slide 28

Slide 28 text

But more importantly…

Slide 29

Slide 29 text

Links & server-side routing are Progressive enhancement

Slide 30

Slide 30 text

React Router https://github.com/ReactTraining/react-router

Slide 31

Slide 31 text

Flatiron isomorphic router https://github.com/flatiron/director

Slide 32

Slide 32 text

Choosing the best element for the job

Slide 33

Slide 33 text

craftsmanship Source: http://purpose2play.com/sartonk/

Slide 34

Slide 34 text

This happens sometimes. Just…No.

Slide 35

Slide 35 text

The role of User Experience in web accessibility

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

How about these Edge cases?

Slide 41

Slide 41 text

Calls to action?

Slide 42

Slide 42 text

Should you bind the space key?

Slide 43

Slide 43 text

“The expected result of `Space` on a link element is to scroll the page” -Scott Vinkle

Slide 44

Slide 44 text

What to do? •Research expected interactions. •Discuss URL changes in design reviews. •Weigh design vs. utility of HTML elements. •Match form to function. •Annotate semantics in wireframes. •Annotate interaction modes, i.e. focus.

Slide 45

Slide 45 text

what about Legacy Sites? •Designs get entrenched–you may not have the luxury of going back to fix old patterns. •Use refreshes and agile stories as opportunities to make changes. •Use CSS classes to ease the transition.

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

focus "bugs" a.k.a.Button Focus Hell http://marcysutton.com/button-focus-hell

Slide 48

Slide 48 text

npm install what-input

Slide 49

Slide 49 text

:focusring

Slide 50

Slide 50 text

:focusring

Slide 51

Slide 51 text

Using focus-ring http://github.com/wicg/focus-ring

Slide 52

Slide 52 text

Ideally: Let our userS decide Like this, but for handling focus

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

The Final Smackdown •Use links for navigation •Utilize buttons for toggling, submitting things •Echo function with visual style •Preserve focus styles for keyboard users •Make the most informed choices you can! •There might not always be a clear answer.

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

Find me on the Interwebs: • twitter.com/marcysutton • github.com/marcysutton • axe-core.org Questions?