The Looper Mini Web Machine

Chrome for Developers · Beginner ·🖊️ Copywriting & Content Strategy ·2y ago

Key Takeaways

The Looper Mini Web Machine, a radio group, is showcased for building user experiences with automatically unselecting previous items and supporting mouse, keyboard, screen readers. It's a perfect Mini web machine for less than eight items, with features like roving UX, cyclical focus, and accessibility.

Full Transcript

presenting the Looper a Powerhouse machine for building all sorts of awesome stuff like this and this F this it might not look like much unstyled but it packs a punch of functionality that's Mega [Music] useful the Looper features automatically unselecting the previous item ensuring that only one can be selected at a time and I call it unconcealed because all the options are shown to the user without an action to reveal the full set you know like a select element where you have to click it to see all the options as opposed to this radio Group which just lays them all out there for you it's also super accessible it supports mouse keyboard screen readers and has been a solid little machine for many years it's a perfect Mini web machine to use when there's like less than eight items or so to pick from but if there's more than that there's certainly use cases where you might want to reach for a select or something that does conceal the additional options you know to prevent Choice overload managing State it's super fun and stuff but it's also really fun when the browser manages the state for you and so in the case of this the browser manages the selection State and also offers a few ways to style or access the data from it from CSS we have the checked pseudo class and from JavaScript we can query the checked pseudo class like via query selector or you can use Looper inside of a form and access the selected value from the form data API lots of choices classic web now if it wasn't obvious or maybe you're wondering why I called it at the Looper it's because this supports something called roving Focus or roving index that's like a fancy term for saying it's a meaningful Focus trap that is cyclical upon interaction that cyclical aspect is why I called it the Looper but roving ux has even more features check this out if I had to tab through a 100 videos in that first section just to get to the second section that would be absolutely terrible well the way a radio group works and the way that roving ux works is you focus into that area and then you can move with the arrow keys and if you hit tab again you jump to the next section so you're not trapped inside of there you're actually you go in you dip around with the arrow keys and then you can jump out and go to somewhere else that's very critical in the interaction pattern something to note when you go and copy and paste this machine which I hope you do I am using the implicit label input relation here this is where the input element is inside of the label this means I don't have to use the four attribute or give the input an ID but there's certainly use cases where your label might be somewhere else and your input is somewhere else at which point you can connect them together and by the way always use a label you can connect them together by giving the input an ID and the label element a four attribute that points to that ID now when you click the label it selects that particular radio it's a really cool way to kind of separate your concerns and also build really engaging experiences and a little bonus tip the field set element which you might remember from gooey challenges hopefully you saw some of those episodes it can make observing value changes super easy so normally you might look at each particular input and wait for them to change and then try to manage state that way ah it's really messy or you can use a field set element put all these inside of it and watch for changes on the field set element kind of rolling up all the changes of the inputs into one single place for you to observe and I really like that pattern plus then you get to use the legend element and then you get to be a legend or use a legend I don't know anyway it's the legend element who doesn't want to use that one it just sounds rad so earlier in this episode I teased to some really cool use cases of the Looper and now let's go into those a little bit deeper and try to look like a pro this one is kind of silly it's very literal so here I tab into the radio group and then where's the start and where's the end I don't know cuz someone put this layout of this radio group into a circle and now it goes around forever I can use the up Arrow the down arrow the left Arrow the right arrow and it's just kind of silly it was also a fun use of trigonomic CSS you know make a circle layout that's fun this one you can see the label and the input so there's a pretty strong hint right there that this is backed by the Looper and of course if I tab in I get cyclical uh interaction here so I can kind of loop through these forever and thanks to the view transitions API I can morph between the selection so basically this is a grid layout the current one that's selected the one that's checked remember we saw that CSS hook it's the larger one in the layout but if the checked State changes a different one has become the larger one and I just say hey grid make this one big and hey view transitions I'm going from an old state to a new state would you please morph those elements between the states and it does it all and the final inspirational demo for what you can do with the Looper is this single selection plant Chooser and it does this by well here let's see I'm in a radio group look there's only one checked at a time and if I get to the end and I go back to the beginning there is your strong clue we are trapped inside of some roving ux it's freely delivered by a radio group and the way that this one works is it takes that checked pseudo class that CSS we were talking about earlier and it promotes it by giving it grid template columns it's going to have more FR units assigned to it than the ones next to it so the one in the middle here is getting about five the one on each side is getting about two and a half and the ones at the end are getting one and then as I move through I use the has selector to look at which one is selected and I select the adjacent ones next to it as well as the one here and give them a different size in Fr units and then you can transition grid template columns so you combine transition and grid template columns the Looper element and the easing function for getting springy animations and you've got yourself this super cool rad demo if you liked this episode go ahead and tell us in the comments I'm curious should I keep making more Mini web machines I've got a long list of things that I think make really good little reusable machines but I need to hear from you to let me know so give a like give a subscribe give me a comment and I hope I can send you some more Mini web machines see you later y'all [Music]

Original Description

Introducing Mini Web Machines, where we dive into small groups of code that drive rad user experiences. This debut episode showcases The Looper, aka a radio group. Copy the code → https://goo.gle/3TTzLMv Resources: The Looper roving UX → https://goo.gle/3VLjaNI Cyclical radio group → https://goo.gle/3Jcqjz3 Radiento bento group → https://goo.gle/43ToWPl Bouncy plant picker → https://goo.gle/3xxutPt Chapters: 0:00 - Introduction 1:27 - The Looper 3:30 - Use cases 5:37 - Wrap up Watch more Mini Web Machines → https://goo.gle/MiniWebMachines Subscribe to Chrome for Developers → https://goo.gle/ChromeDevs #ChromeForDevelopers #Chrome Speaker: Adam Argyle
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Chrome for Developers · Chrome for Developers · 0 of 60

← Previous Next →
1 Polymer Performance Patterns (The Polymer Summit 2015)
Polymer Performance Patterns (The Polymer Summit 2015)
Chrome for Developers
2 Polymer Power Tools (The Polymer Summit 2015)
Polymer Power Tools (The Polymer Summit 2015)
Chrome for Developers
3 Chrome Dev Summit 2014 – Chrome Case Studies
Chrome Dev Summit 2014 – Chrome Case Studies
Chrome for Developers
4 Web Directions Code 2015 round up
Web Directions Code 2015 round up
Chrome for Developers
5 Maintainable Code - HTTP203
Maintainable Code - HTTP203
Chrome for Developers
6 iron-ajax… wat?! -- Polycasts #26
iron-ajax… wat?! -- Polycasts #26
Chrome for Developers
7 The Guardian - Supercharged
The Guardian - Supercharged
Chrome for Developers
8 ES2015 (next version of JavaScript), Totally Tooling Tips (S2 Ep1)
ES2015 (next version of JavaScript), Totally Tooling Tips (S2 Ep1)
Chrome for Developers
9 #AskPolymer: Rob answers all the questions ever -- Polycasts #27
#AskPolymer: Rob answers all the questions ever -- Polycasts #27
Chrome for Developers
10 The Future of JavaScript - HTTP203
The Future of JavaScript - HTTP203
Chrome for Developers
11 Data Binding 101 -- Polycasts #28
Data Binding 101 -- Polycasts #28
Chrome for Developers
12 The Guardian part 2 - Supercharged
The Guardian part 2 - Supercharged
Chrome for Developers
13 The Future of Web Audio: with Chris Wilson and Chris Lowis
The Future of Web Audio: with Chris Wilson and Chris Lowis
Chrome for Developers
14 Chrome 46: New motion-path animations, client hints and service worker improvements
Chrome 46: New motion-path animations, client hints and service worker improvements
Chrome for Developers
15 Sublime Snippets, Totally Tooling Tips (S2 Ep2)
Sublime Snippets, Totally Tooling Tips (S2 Ep2)
Chrome for Developers
16 #AskPolymer: How do you make the show? -- Polycasts #29
#AskPolymer: How do you make the show? -- Polycasts #29
Chrome for Developers
17 Critical Path CSS, Totally Tooling Tips (S2 Mini Tip #1)
Critical Path CSS, Totally Tooling Tips (S2 Mini Tip #1)
Chrome for Developers
18 Binding to Objects -- Polycasts #30
Binding to Objects -- Polycasts #30
Chrome for Developers
19 Player FM - Supercharged
Player FM - Supercharged
Chrome for Developers
20 Where’s the Designer? #AskPolymer -- Polycasts #31
Where’s the Designer? #AskPolymer -- Polycasts #31
Chrome for Developers
21 Jake Beats Wikipedia - HTTP203
Jake Beats Wikipedia - HTTP203
Chrome for Developers
22 Supercharged Observers! -- Polycasts #32
Supercharged Observers! -- Polycasts #32
Chrome for Developers
23 Jai's Web blog - Supercharged
Jai's Web blog - Supercharged
Chrome for Developers
24 Windows Command-line Tooling, Totally Tooling Tips (S2, Ep4)
Windows Command-line Tooling, Totally Tooling Tips (S2, Ep4)
Chrome for Developers
25 What about internationalization? #AskPolymer -- Polycasts #33
What about internationalization? #AskPolymer -- Polycasts #33
Chrome for Developers
26 Developing for Billions (Chrome Dev Summit 2015)
Developing for Billions (Chrome Dev Summit 2015)
Chrome for Developers
27 Google+ Performance Improvement Comparison
Google+ Performance Improvement Comparison
Chrome for Developers
28 Deploying HTTPS: The Green Lock and Beyond (Chrome Dev Summit 2015)
Deploying HTTPS: The Green Lock and Beyond (Chrome Dev Summit 2015)
Chrome for Developers
29 Progressive Web Apps (Chrome Dev Summit 2015)
Progressive Web Apps (Chrome Dev Summit 2015)
Chrome for Developers
30 Instant Loading with Service Workers (Chrome Dev Summit 2015)
Instant Loading with Service Workers (Chrome Dev Summit 2015)
Chrome for Developers
31 Increase Engagement with Web Push Notifications (Chrome Dev Summit 2015)
Increase Engagement with Web Push Notifications (Chrome Dev Summit 2015)
Chrome for Developers
32 Engaging with the Real World: Web Bluetooth and Physical Web (Chrome Dev Summit 2015)
Engaging with the Real World: Web Bluetooth and Physical Web (Chrome Dev Summit 2015)
Chrome for Developers
33 Asking for Permission: respectful, opinionated UI (Chrome Dev Summit 2015)
Asking for Permission: respectful, opinionated UI (Chrome Dev Summit 2015)
Chrome for Developers
34 Polymer - State of the Union (Chrome Dev Summit 2015)
Polymer - State of the Union (Chrome Dev Summit 2015)
Chrome for Developers
35 Building Progressive Web Apps with Polymer (Chrome Dev Summit 2015)
Building Progressive Web Apps with Polymer (Chrome Dev Summit 2015)
Chrome for Developers
36 Introduction to RAIL (Chrome Dev Summit 2015)
Introduction to RAIL (Chrome Dev Summit 2015)
Chrome for Developers
37 DevTools in 2015: Authoring to the max (Chrome Dev Summit 2015)
DevTools in 2015: Authoring to the max (Chrome Dev Summit 2015)
Chrome for Developers
38 RAIL in the real world (Chrome Dev Summit 2015)
RAIL in the real world (Chrome Dev Summit 2015)
Chrome for Developers
39 #ChromeDevSummit talks are up - W00T! -- Polycast #34
#ChromeDevSummit talks are up - W00T! -- Polycast #34
Chrome for Developers
40 V8 Performance from the Driver's Seat (Chrome Dev Summit 2015)
V8 Performance from the Driver's Seat (Chrome Dev Summit 2015)
Chrome for Developers
41 Quantify and improve real-world RAIL (Chrome Dev Summit 2015)
Quantify and improve real-world RAIL (Chrome Dev Summit 2015)
Chrome for Developers
42 Owning your performance: RAIL (Chrome Dev Summit 2015)
Owning your performance: RAIL (Chrome Dev Summit 2015)
Chrome for Developers
43 HTTP/2 101 (Chrome Dev Summit 2015)
HTTP/2 101 (Chrome Dev Summit 2015)
Chrome for Developers
44 Leadership Panel (Chrome Dev Summit 2015)
Leadership Panel (Chrome Dev Summit 2015)
Chrome for Developers
45 Build Processes, Totally Tooling Tips (S2, Ep 5)
Build Processes, Totally Tooling Tips (S2, Ep 5)
Chrome for Developers
46 Accessibility (Chrome Dev Summit 2015)
Accessibility (Chrome Dev Summit 2015)
Chrome for Developers
47 Binding to Arrays -- Polycasts #35
Binding to Arrays -- Polycasts #35
Chrome for Developers
48 HTTP2 - HTTP203
HTTP2 - HTTP203
Chrome for Developers
49 Chrome 47: Splash Screens, requestIdleCallback and better desktop notifications (New in Chrome)
Chrome 47: Splash Screens, requestIdleCallback and better desktop notifications (New in Chrome)
Chrome for Developers
50 Call For Submissions - Supercharged
Call For Submissions - Supercharged
Chrome for Developers
51 Cross Device Testing, Totally Tooling Tips (S2 Ep6)
Cross Device Testing, Totally Tooling Tips (S2 Ep6)
Chrome for Developers
52 Testing AJAX with Web Component Tester -- Polycasts #37
Testing AJAX with Web Component Tester -- Polycasts #37
Chrome for Developers
53 Slack: Extended Xmas Special - Supercharged
Slack: Extended Xmas Special - Supercharged
Chrome for Developers
54 Browser testing with Travis & Sauce Labs -- Polycasts #38
Browser testing with Travis & Sauce Labs -- Polycasts #38
Chrome for Developers
55 Optimize for production with Vulcanize -- Polycasts #39
Optimize for production with Vulcanize -- Polycasts #39
Chrome for Developers
56 Highlights from Chrome Dev Summit 2015
Highlights from Chrome Dev Summit 2015
Chrome for Developers
57 Chrome 48: Custom buttons in notifications, DevTools Security panel, and Presentation mode
Chrome 48: Custom buttons in notifications, DevTools Security panel, and Presentation mode
Chrome for Developers
58 Crisper: Protecting your Polymer app with CSP -- Polycasts #40
Crisper: Protecting your Polymer app with CSP -- Polycasts #40
Chrome for Developers
59 How do I use Sass with Polymer? #AskPolymer -- Polycasts #41
How do I use Sass with Polymer? #AskPolymer -- Polycasts #41
Chrome for Developers
60 Colors – DevTools Tonight #0 (Pilot)
Colors – DevTools Tonight #0 (Pilot)
Chrome for Developers

The Looper Mini Web Machine is a radio group that provides a simple and accessible way to build user experiences. It features roving UX, cyclical focus, and accessibility, making it perfect for less than eight items. The video showcases how to use The Looper, its features, and provides inspirational demos.

Key Takeaways
  1. Copy the code for The Looper
  2. Understand the features of The Looper, such as roving UX and cyclical focus
  3. Implement The Looper in a web project
  4. Style The Looper with CSS
  5. Use JavaScript to access the selected value
💡 The Looper provides a simple and accessible way to build user experiences, with features like roving UX and cyclical focus, making it perfect for less than eight items.

Related Reads

Chapters (4)

Introduction
1:27 The Looper
3:30 Use cases
5:37 Wrap up
Up next
Customers might need multiple interactions before they buy from you.
Merit Marketing Services
Watch →