Everything you didn't know you need to know about buttons

  Рет қаралды 32,852

Steve (Builder.io)

Steve (Builder.io)

Күн бұрын

Find all the code examples, as well as more detail on everything discussed here, in my full article: www.builder.io...
#javascript #html #css #webdev #react

Пікірлер: 96
@Steve8708
@Steve8708 Жыл бұрын
All the code examples, as well as more detail on everything discussed here, in my full article: www.builder.io/blog/buttons
@StephenGillie
@StephenGillie Жыл бұрын
Go team Steve!
@dotterel
@dotterel Жыл бұрын
I've been studying CSS for a couple years now and this is hands down the best video I've seen. I love how you went through each one and explain when and why we use each element. I have a lot of trouble learning when people don't explain 'what does this allow us to do and what are we not able to do without it?' You really hit the nail on the head here. I feel like I understand the reasoning behind all 3 cases after just 1 watch, that's pretty incredible.
@rdalago
@rdalago Жыл бұрын
I've been learning A LOT from you! The way your videos are short yet delivering a deep explanation is spot on for me! Thank you.
@omersoncruz1081
@omersoncruz1081 Жыл бұрын
agreed. Short, concise, and full of practical knowledge.
@Htbaa
@Htbaa Жыл бұрын
For accessibility try not to reinvent controls unless you really have to, but make sure you’re making it accessible! When clicking on this video I was afraid accessibility would be neglected. Happy to see it’s the focus of the video.
@hnccox
@hnccox Жыл бұрын
That MyButton component is actually really nice! Never thought of that. My rule of thumb is that a button is for interaction for things that happen on the current page only, anchor tags are for navigation only.
@JEsterCW
@JEsterCW Жыл бұрын
Holy sheee, this is quality content. I have watched few of ur shorts before, but after this video i was 100% sure i wanna follow u constantly.
@nicolasguillenc
@nicolasguillenc Жыл бұрын
Literally amazing man. One of the best tutorials I've ever seen. It's humbling because who thinks about buttons twice? But there's so mucho to know
@yangenmanuel2659
@yangenmanuel2659 Жыл бұрын
I just discovered this channel and I need to watch all of your videos!!!
@mervinmarias9283
@mervinmarias9283 Жыл бұрын
Was watching your video and was whole time thinking, "why not just make it a web component?". Then you actually did exactly as I thought lol.
@aPinix
@aPinix Жыл бұрын
I already knew this but learned it the hard way unfortunately. Thank you for for evangelizing this knowledge for everyone. Cheers!
@re.liable
@re.liable Жыл бұрын
Just starting to watch. The "rule" I try to remember is: anchor for navigation, button for interaction The styling bits are the reason why a CSS reset is necessary for me. The conditional rendering is nice I suppose
@uscjake868
@uscjake868 Жыл бұрын
Outstanding. I love the style of demonstrating the good and the bad. You saved a lot of trial and error.
@zombiefacesupreme
@zombiefacesupreme Жыл бұрын
You know someone has only coded in React when they make fun of the idea of "button"
@yuryitikhonoff9631
@yuryitikhonoff9631 Жыл бұрын
OMG. It's a gem. So concise and meaningful. Thanks a lot to the author.
@AmxCsifier
@AmxCsifier Жыл бұрын
Just great and useful content, no filler no spam no nonsense... This is why I open youtube This channel deserves at least 1 mil subs, I hope you get there someday
@duccdefgab
@duccdefgab Жыл бұрын
i've learned so much in just 4 minutes. Great content 👏👏👏
@mattshnoop
@mattshnoop Жыл бұрын
Also good to look into the other focus styles! There are focus-within and focus-visible. Good for other things.
@Biowulf21
@Biowulf21 Жыл бұрын
Looks like I have a new channel to binge
@jamiroquaiordie
@jamiroquaiordie Жыл бұрын
May I just discovered my new favourite full-stack dev youtuber? I guess I did
@cotneit
@cotneit Жыл бұрын
all: unset blew my mind, can't believe this is the first time I'm hearing about it
@lamarredavy8145
@lamarredavy8145 Жыл бұрын
Thank you for all your videos, short and so usefull !
@peteryates308
@peteryates308 Жыл бұрын
As someone who builds accessible websites, it's easiest to just stick to the intended purpose of the element. Buttons submit (or reset forms), anchors create hyperlinks. They are both accessible and understood by just about all assistive software and have worked in the same fashion for 30 years. Yeah, if you're building something fancy then adding custom functionality to role=button buttons is fair, but I see so many people starting from scratch without realising they've lost accessibility features along the way.
@ГерриПитт
@ГерриПитт Жыл бұрын
Nice! That was helpful, man!
@umutelicabuk6834
@umutelicabuk6834 Жыл бұрын
I usually don't comment but now I have to. Steve - your delivery is among the cleanest, most concise yet deep teaching styles I have ever come across. You definitely need some more zeros behind that sub count!
@BritainRitten
@BritainRitten Жыл бұрын
Excellent video, thanks for explaining.
@RicardoValero95
@RicardoValero95 Жыл бұрын
This is great Still I’d love to see the div button fully reimplemented
@webdevschool6597
@webdevschool6597 Жыл бұрын
Fantastic tutorial, thanks a lot man.
@mohamedcherif9878
@mohamedcherif9878 Жыл бұрын
I learned something new today thank you
@EthanStandel
@EthanStandel Жыл бұрын
I think it would have been worth it to note that you probably want :focus-visible and not just :focus styles.
@Steve8708
@Steve8708 Жыл бұрын
Ah yes! Just learned about this after posting the vid, but updated the blog post to use focus-visible
@EthanStandel
@EthanStandel Жыл бұрын
@@Steve8708 nice! Otherwise, this was excellent and something that everyone building a component library should watch just to see the base considerations of things you might want to call "simple"
@Noam-Bahar
@Noam-Bahar 7 ай бұрын
Incredible video 👏
@berightben8318
@berightben8318 Жыл бұрын
Quality, pure quality. Subscribe
@JenilCalcuttawala
@JenilCalcuttawala Жыл бұрын
Great video! 👏
@pizzasteve-is-here
@pizzasteve-is-here Жыл бұрын
awesome, keep going
@nurhamsah_tech
@nurhamsah_tech Жыл бұрын
Wow, thanks man 👍👍
@ShaharHarshuv
@ShaharHarshuv Жыл бұрын
Do people actually still use the native submit functionality?
@arianj2863
@arianj2863 Жыл бұрын
Why not wrap a button with an anchor tag?
@p0358
@p0358 Жыл бұрын
It’s a good video, but in a few places at the beginning your audio was cut a bit badly, some of the words you spoke were cut off in the middle, making it a bit awkward to listen to
@tounsoo
@tounsoo Жыл бұрын
Typescript version of this is super messy. You have to use polymorphic methods to get the correct type inferred and its a pain. After experiencing, I now like to separate them into and for better and cleaner type.
@mahadevovnl
@mahadevovnl Жыл бұрын
If I see one more job application project where people NEST a and an I'll cry. W3C standards exist for many reasons. Mixing conflicting interactive elements makes my brain hurt.
@TheBaca91
@TheBaca91 Жыл бұрын
I think that this kind of merge of buttons and link are not good mainly because it blurs distinctions between these two tags. In real designing scenarios there should be clear styling diference between how button and how link looks like so user know what to expect. If its button it will perform some kind of action, as for link it expects routing behaviour. So in your case you would need to pass variant to your merge button. But that button variant could be applied on both elements wich will cause undesired styles for one. It is much more clear to have buttons separetad from links since in its nature they are not same html tags. Besides it would be weird from dev perspective to see button with hrf atribute. We should keep our code ease to read
@kingl5519
@kingl5519 Жыл бұрын
Subscribed.
@6644guilherme
@6644guilherme Жыл бұрын
I like the part where he says "type equals butt..."
@vinaciotm
@vinaciotm 8 ай бұрын
all: unset !!! Wow nice 👍
@frontend_ko
@frontend_ko Жыл бұрын
Nice frontend tip
@mfkfawas5157
@mfkfawas5157 Жыл бұрын
Amazing
@Marcus-cf2li
@Marcus-cf2li Жыл бұрын
Great
@tommy_corey
@tommy_corey Жыл бұрын
Wow I didnt know pewdiepie knew how to code
@jeramymorrill2729
@jeramymorrill2729 6 ай бұрын
Switching the tag type behind the component is much to magic. Unless you work totally alone, you have created a scenario where someone using your component will think they are getting a button and may be getting an anchor. Components should be simple, pure and never contain magic.
@MaxFunoff
@MaxFunoff Жыл бұрын
MyButton component like this example is an unnecessary abstraction...
@ricko13
@ricko13 Жыл бұрын
💪
@unifiedcodetheory8406
@unifiedcodetheory8406 Жыл бұрын
All of the issues you mentioned with using the button tag are actually non-issues. Especially since you're using react, you would never just use a button tag anyway. You should make your own button components for coupling styles and functionality.
@Nodsaibot
@Nodsaibot Жыл бұрын
lol F accessibility use your div my man
@amitse
@amitse Жыл бұрын
Another discussion is on button disabled state and the color contrast debate around it. Another thing to remember you can’t disable links. All you can do is to hide them.
@SzaboB33
@SzaboB33 Жыл бұрын
Great video, I did not know I needed this but the a vs div vs button problem was quite frequent for me and this video cleared things up
@igigloo
@igigloo Жыл бұрын
what about input type=button? is there any difference with a normal button type=button?
@Unc3
@Unc3 Жыл бұрын
if (event.key === Space || Enter) is borked logic. Just saying
@ivankraev4264
@ivankraev4264 Жыл бұрын
You are like Matt Pocock but for javascript 😀 Great content
@NoName-1337
@NoName-1337 Жыл бұрын
Nice, didn't know about all:unset. Thank you!!!
@godofwar8262
@godofwar8262 7 ай бұрын
More videos please
@khairulhaaziq2332
@khairulhaaziq2332 Жыл бұрын
Steve your teaching method is the most comprehensible i've come accross. Please continue making these! I really hope you release some more basic stuffs also
@lescobrandon2202
@lescobrandon2202 Жыл бұрын
Buttons suck.
@anuvette
@anuvette 10 ай бұрын
not knowing button is type submit by default gave me so much headache
@joostschuur
@joostschuur Жыл бұрын
I hate that I learned so much about buttons from this video. Thanks, Steve. I hope you're happy. Also, keep up the good work 😊
@toby_cm
@toby_cm Жыл бұрын
Can you add back the subtitles like before? I really appreciate them
@tariksohan8993
@tariksohan8993 Жыл бұрын
Simple with good explanation. My favourite kinda Ytber.
@edwardmacnab354
@edwardmacnab354 7 ай бұрын
you guys always end up making things way more complicated than it needs to be . I don't mean YOU as a teacher , I mean the designers of this crap !
@lukecartwright613
@lukecartwright613 Жыл бұрын
Super explanation video! This was brilliant! Thank you for sharing
@Ismail-hq8cq
@Ismail-hq8cq Жыл бұрын
Is this a coincidence, or does the youtube algorithm know what is in my mind ? I wanted to learn how to make a text clickable, and this video is the first video in my feed.
@termisher5676
@termisher5676 Жыл бұрын
Bruh Now we have problem Now that is not working Now this is broken. Why do you touch it let it be.
@shutdow88
@shutdow88 Жыл бұрын
Great content, as all other channel videos ...so no need for the clickbait face expression in thumbnails 😜
@TheVralapa
@TheVralapa Жыл бұрын
Prefer outline-color:transparent; over outline:none; better for high contrast themes.
@StephenGillie
@StephenGillie Жыл бұрын
Go the other way - use an A link with Javascript onclick. This is great for SPA page rewrites.
@WabuhWabuh
@WabuhWabuh 8 ай бұрын
if you wanted to just teach html, dont put it in javascript...
@SushilKumar-ig8ls
@SushilKumar-ig8ls Жыл бұрын
Great unknowns to know for me 😀 Thanks a lot for these tricks
@sveinnthz
@sveinnthz Жыл бұрын
instantly subscribed, best presented web dev video i’ve ever seen
@heyjitendra
@heyjitendra Жыл бұрын
Wow. Amazing content Steve
@ricko13
@ricko13 Жыл бұрын
what if you add role="button" to an anchor tag?
@youngnwadike5312
@youngnwadike5312 Жыл бұрын
I love this, thanks Steve
@kittyrah2800
@kittyrah2800 Жыл бұрын
Why not use ?
@FunctionGermany
@FunctionGermany Жыл бұрын
awesome tutorial!
@thedigitalceo
@thedigitalceo Жыл бұрын
This was great Steve. Thank you 🙏🏼 I think for things with anchor tags we should probably use buttons for accessibility purposes. I love the one component you showed to render the consistent button!! Although our designers tend to have a few button variations so would be good to see that as well. Would love to have you on my channel for a collab once. Thank you again!
@loia5tqd001
@loia5tqd001 Жыл бұрын
Love this so much ❤ all the details people usually overlook or don’t talk about
@YashKadamYT
@YashKadamYT Жыл бұрын
This is so concise & useful! Thanks a lot for sharing!
@joemathan6101
@joemathan6101 Жыл бұрын
Wow wow wow!!! Appreciate your efforts on explaining minor details
@dinaiswatching
@dinaiswatching Жыл бұрын
Thanks, that sure was helpful. Since I've been using qwik, it's nice to know the nitty and gritty details of some html tags
@gnaneshwarrao174
@gnaneshwarrao174 Жыл бұрын
Thank you so much for sharing. I always was fumbled in this conundrum and now you gave a solution with your pattern. Thanks a ton!
@srkuleo
@srkuleo Жыл бұрын
Well this was way more useful than I thought it would be. Really nice trick with conditional.
@kenfrostyypaws9113
@kenfrostyypaws9113 Жыл бұрын
You're absolutely nailing this format my guy. Keep em coming!
@8koi245
@8koi245 Жыл бұрын
The style of the code and browser window is LOVELY
@shakapaker
@shakapaker Жыл бұрын
Oh my god that way of explaining things it's just amazing
All The JavaScript You Need To Know For React
28:00
PedroTech
Рет қаралды 619 М.
отомстил?
00:56
История одного вокалиста
Рет қаралды 7 МЛН
Стойкость Фёдора поразила всех!
00:58
МИНУС БАЛЛ
Рет қаралды 3 МЛН
Please Help This Poor Boy 🙏
00:40
Alan Chikin Chow
Рет қаралды 16 МЛН
Man Mocks Wife's Exercise Routine, Faces Embarrassment at Work #shorts
00:32
Fabiosa Best Lifehacks
Рет қаралды 5 МЛН
The Biggest Issues I've Faced Web Scraping (and how to fix them)
15:03
Using CSS custom properties like this is a waste
16:12
Kevin Powell
Рет қаралды 172 М.
The # 1 Mistake Websites Make with Lazy Loading Images
24:28
DebugBear
Рет қаралды 1,4 М.
Revealing the Differences between HTML Dialogs and the Popover API
24:14
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 8 М.
10 Tailwind Tricks You NEED To Know!
10:45
Ravi - Perfect Base
Рет қаралды 294 М.
10 CSS Pro Tips - Code this, NOT that!
9:39
Fireship
Рет қаралды 2,2 МЛН
Why are people SO obsessed with useSignal()?
3:41
Steve (Builder.io)
Рет қаралды 69 М.
The Easiest Way to Build Websites
10:56
Sajid
Рет қаралды 493 М.
JavaScript Visualized - Event Loop, Web APIs, (Micro)task Queue
12:35
Top 10 CSS One Liners That Will Blow Your Mind
13:34
developedbyed
Рет қаралды 961 М.
отомстил?
00:56
История одного вокалиста
Рет қаралды 7 МЛН