Тёмный

React Storybook Crash Course 

Web Dev Simplified
Подписаться 1,6 млн
Просмотров 326 тыс.
50% 1

Designing and testing components is crucial to every application, but it can be difficult to view components in isolation. This makes it hard to design and test components, but with Storybook this is no longer an issue. Storybook makes developing, testing, and working with a component library so much easier. You can test complex actions and ensure your components are always working as expected. In this video I will be showing you how to setup Storybook in React and how to create everything from basic to more advanced stories.
📚 Materials/References:
GitHub Code: github.com/WebDevSimplified/s...
PropTypes Video: • Learn React PropTypes ...
PropTypes Article: blog.webdevsimplified.com/202...
🌎 Find Me Here:
My Blog: blog.webdevsimplified.com
My Courses: courses.webdevsimplified.com
Patreon: / webdevsimplified
Twitter: / devsimplified
Discord: / discord
GitHub: github.com/WebDevSimplified
CodePen: codepen.io/WebDevSimplified
⏱️ Timestamps:
00:00 - Introduction
00:24 - Demo
01:10 - Setup
04:10 - How to create a basic story
06:40 - Add interactivity to stories
09:52 - Create multiple stories for one component
10:59 - Advanced stories
#ReactStorybook #WDS #React

Опубликовано:

 

17 май 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 205   
@RexGalilae
@RexGalilae 2 года назад
This guy's a perfect juxtaposition of "nerd" and "chad" and I don't even know how he manages it
@Pururin_Purin
@Pururin_Purin 2 года назад
its the hair
@vnoommuy
@vnoommuy 2 года назад
He's a CHARD!
@jr-yn4lk
@jr-yn4lk 2 года назад
step 1: be a handsome white male step 2: teach geeky stuff on youtube
@hardwired89
@hardwired89 2 года назад
hahahaha
@josersleal
@josersleal 2 года назад
he's competent. that's all that matters. He's young and that we all had. When age fades he can still be competent. Good job in your videos.
@joannagoofit7253
@joannagoofit7253 11 часов назад
thanks for your movies. I used to watch them during my bootcamp, when i wanted to become Dev. And I still watch them as they are useful at work :)
@none0n
@none0n Год назад
This is a perfect Storybook walkthrough... I am pretty confident to start this new role. Thank you
@dominiquebello3212
@dominiquebello3212 2 года назад
Perfect timing! Already liking storybook a lot thanks to your super condensed and helpful crash course 👋👌🤩
@thedevguild7525
@thedevguild7525 Год назад
I highly recommend this video tutorial. This is easily the best video or even tutorial to start learning React Storybook with! I have followed along and code the 2 components. Through it, I have learnt so much. When I read up other tutorials and the official documentation, the concepts just fit like a puzzle.
@megapixel23
@megapixel23 2 года назад
That’s exactly what I needed to get started with the Storybook. Thanks a lot, you are doing a great job 👏
@Bad_Chad
@Bad_Chad 2 года назад
Seriously, I tried a dozen other videos and this is by far the best walkthrough.
@monique2819
@monique2819 Год назад
I had to learn this for my job and you explained Storybook so well. Great tutorial!!!!!😊👍🏽
@KevinVandyTech
@KevinVandyTech 2 года назад
I've used storybook for 2 years at 2 different companies. It's awesome
@federicomedinauy
@federicomedinauy 2 года назад
Excellent video! Love your content, very clear, precise and straight to the point. For readers, something not mentioned in the video is that the “args” object can also be specified in the export default object (above const Template) and it would apply to all exported stories (the ones below const Template), reducing the need to repeat the same, common args values in each story variation.
@VacaAlpha
@VacaAlpha Год назад
by that you mean you would only repeat the arguments that you wanna change? as in, for example: specify args object inside the export default with backgroundColor: "red" and then only specify it again where you actually do need a different color?
@federicomedinauy
@federicomedinauy Год назад
@@VacaAlpha Yeah. You only specify it again when you actually need a different default color for that one particular story.
@TomDoesTech
@TomDoesTech 2 года назад
Storybook is great! I love using it with tsdx to create component modules.
@stelagadevska4342
@stelagadevska4342 2 года назад
Thank you for the simplified explanation! It was easy to understand and still interesting. Great tutorial! :)👏🧠
@isareinert8031
@isareinert8031 2 года назад
Thank you 🙏 I use storybook at work. It’s really helpful to understand the project. When you need to understand what this component does, just check your storybook. I liked your video so much. I hope you can make more videos about it. See you
@vnoommuy
@vnoommuy 2 года назад
.hair { position: fixed; }
@rizqyhbb
@rizqyhbb 2 года назад
After watching whole playlist from another youtuber, now I can say that I can keep up with Kyle's teaching speed and understand all of this storybook video haha, thanks Kyle
@ecam90
@ecam90 2 года назад
Excited for this one! Thanks for the video!
@GnomePuntTrainerYT
@GnomePuntTrainerYT 2 года назад
Nice timing! I read up quickly on storybooks a month ago and forgot about it. Will be fun to watch this and test some of it myself :D
@bama2619
@bama2619 Год назад
man, I am back to your video to try. Now I understand how to do this. Fast and to the point. Thank you.
@larzo1337
@larzo1337 2 года назад
Great video! High tempo yet easy to follow
@alvacoach
@alvacoach 2 года назад
No way! You read my mind or something. At work they told me on Thursday to look into Storybook, we will start implementing it soon. And just like that you release a video about it, unbelievable!
@emgodas
@emgodas 3 месяца назад
God works in mysterious ways buddy
@alvacoach
@alvacoach 3 месяца назад
@@emgodas Amen!
@motr3bam867
@motr3bam867 2 года назад
Kyle I have learned so much from you. Thanks man... Thanks ❤
@maheshgunjal1092
@maheshgunjal1092 2 года назад
Finally found perfect video to understand the video. Good work bro
@callumgrayson1010
@callumgrayson1010 Год назад
WDS has the highest value-per-minute of any web tech channel! This intro to not only informs me but actually motivates me to use Storybook! Outstanding work. Thanks.
@avinashchaudhary4231
@avinashchaudhary4231 Год назад
thats the main thing i like about this channel. Thanks WDS
@shachaha
@shachaha 2 года назад
Can't believe that were 17 minutes! Great style of explanation! I appreciate that you speak relatively fast, even as a non-native it was just perfect to follow along. Hallo but where
@bama2619
@bama2619 Год назад
Thank you, great explanation. I am a beginner in SB and React. I just created my first app in react and installed my Sb. Your instructions were helpful. I could not catch up with the speed you created all the components in your story book, because I still have to master js. Great video though! Good for those who already know the js. I have to use typescript.
@asbeldev3071
@asbeldev3071 2 года назад
Thanks you. Now i have much more the concept storybook
@user-hn1ph6ry8l
@user-hn1ph6ry8l Год назад
Thanks for the great video, really clear view to the Storybook.
@jotasenator
@jotasenator 2 года назад
is just me or this chanel is the best ever!!!. thanks Kyle for this video
@AgneMedia
@AgneMedia 2 года назад
Thank you This is great explaining and sample to start with storybook
@hk-nu2zt
@hk-nu2zt Год назад
to the point tutorial now I am confident enough to write storybook in my cv
@RyanJohnson
@RyanJohnson 2 года назад
Finally a Storybook tutorial that works!
@jeisongarzon6066
@jeisongarzon6066 2 года назад
Ty bro amazing explanation, i learned too much also with the proptypes video, ty !
@RizaHariati
@RizaHariati Год назад
Very clear explanation. Thank you!
@Francois3k
@Francois3k 2 года назад
Brother you are the truth. I was gonna buy coding phase course on storybooks an this video hit the spot for me. Man thank u for this info u save me money 💰 🤑 💸 lol
@yyxx9309
@yyxx9309 Год назад
Man this is awesome thank you so much!!!
@licokr
@licokr 2 года назад
Thank you, it's perfect!
@abubakiruralov5543
@abubakiruralov5543 11 месяцев назад
you are amazing!!! THANK YOU FOR TEACHING AND PLEASE UPLOAD MORE VIDEOS
@asifurrahman5436
@asifurrahman5436 5 месяцев назад
thanks for this awesome tutorial
@amauryperalta4364
@amauryperalta4364 Год назад
Excellent video, thanks Kile
@Ipauler
@Ipauler Год назад
great ! simple and short
@erikleo5727
@erikleo5727 Год назад
Looks good, I can't wait for the day these types of tutorials use typescript by default
@nastiak4044
@nastiak4044 2 года назад
Hey! Great video! Thanks. Can you make one for storybook with angular?
@hadjerjoo6744
@hadjerjoo6744 10 месяцев назад
great tutorial ! thank you so much
@jamesdillon738
@jamesdillon738 9 месяцев назад
After I've finished creating the horizontal Stack story at 15:30, the 'defaultValue: 4' argType hasn't pulled through to StoryBook. In Storybook it just has 1 red box and it asks me to set the number manually from the Controls section. Has there been an update to the defaultValue argType which explains why this has happened?
@ferhatdursun5689
@ferhatdursun5689 Год назад
Thank you!!
@AbhishekMishra-uh6du
@AbhishekMishra-uh6du 2 года назад
Thank you for this video
@justinmeskan4410
@justinmeskan4410 2 года назад
Nice intro... Keep them coming my friend
@Ntnismink
@Ntnismink Год назад
OMG 100% quality contents
@BusinessWolf1
@BusinessWolf1 11 месяцев назад
bro you are a godsend
@ThiagoVieira91
@ThiagoVieira91 2 года назад
Aaaand I just got started on Storybook during an Uber ride. You're awesome, Kyle! Thank you! 💯
@Yanis1
@Yanis1 2 года назад
Awesome 🖤🖤
@dragonAwkward
@dragonAwkward Год назад
Nice crash course!
@jeanmarcr9196
@jeanmarcr9196 2 года назад
When you create stories at 10:06 how do you use those buttons in your component ?
@kasunedward962
@kasunedward962 Год назад
Great tutorial
@travelingmindful
@travelingmindful 2 года назад
Appreciate this overview. I sorta wish the child component had been broken into a 2nd video and some use case examples were provided. Why would we ever want stacks of buttons in a UI scenario? Maybe taking the time to provide more context and showing use cases for advanced scenarios would be more helpful. Felt a little intense in the last minutes of the video cramming detail
@amjadshadid90
@amjadshadid90 2 года назад
thank you the suitable video at the suitable time
@cyril7104
@cyril7104 2 года назад
That is so strange, exactly when i need, these weeknds!!
@ahmadjonabdusamadov4282
@ahmadjonabdusamadov4282 2 года назад
thank you man:)
@user-pp1oc7kc9r
@user-pp1oc7kc9r Год назад
Great but it would be nice to add a little bit about snapshot (integration) testing in Storybook!
@saiprathap9550
@saiprathap9550 2 года назад
very help full
@thedevguild7525
@thedevguild7525 Год назад
Hi, sorry to trouble you, could you explain a part of your code in 13:37 (extract below) I am not sure if Array is a component or referring to the type e.g. new Array()? I also need help explain the role of how the spread operator and .key() plays in dynamically adjusting the child element. [...Array(numberOfChildren).keys()].map......
@artem_zakharchuk
@artem_zakharchuk 4 месяца назад
It is very explicit, thank you! But how to use it in my app? Do I need just to import the story Component and work with it like with a simple Component?
@sudeepchoudhary5467
@sudeepchoudhary5467 2 года назад
Great video
@Tinandel
@Tinandel 10 месяцев назад
Our component design team mandated everybody start using this and.... the Storybook web site does an atrocious job explaining either how to really use Storybook, or the benefits thereof. To that end, thanks for the video.
@show_me_the_moneyy
@show_me_the_moneyy 9 месяцев назад
As always quick and to the point but tbh not sure if storybook really adds value and if it can be maintained as a project catches speed - writing unit tests and maintaining test coverage itself is a chore and now this - not sure if teams have got the bandwidth to go with something like storybook - IMO deliverables would maybe crawl with sb
@maresstefan3391
@maresstefan3391 Год назад
Really awesome. How caould I publish the components that I use to npm?
@rajabnatshah6256
@rajabnatshah6256 Год назад
Thank you :)
@HumbertoRincon
@HumbertoRincon 2 года назад
It's my perception, or did you increased the speed slightly? 👍
@sitedel
@sitedel 2 года назад
So storybook is a way to describe customized web component's ? I didn't know this tool, great discovery !
@sitedel
@sitedel 2 года назад
... but in the example I don't like the idea of setting a color property because It may he difficile to adapt afterwards for dark mode or color blindness. I prefer to associate semantics to a component like "strong", "alert", "warning*, "validate", "reset", "update", "apply", "cancel*, and so on and so forth. Then telling that the "alert" behaviour leaf to white text on red background, to red button with some fancy shadow, can be done with CSS.
@CadPixel-why-not2455
@CadPixel-why-not2455 Год назад
nice vid thanks i learnt a lot
@aqibfayyaz1619
@aqibfayyaz1619 Год назад
Awesomeeeeee!!
@arshdeepkumar2586
@arshdeepkumar2586 2 года назад
god level video, i was looking fot this i like to meet you someday
@feossandon
@feossandon 2 года назад
What a nice video! Please try to go around GraphQL in the future C:
@yokiyu799
@yokiyu799 2 года назад
Thumb before watch, trust me!
@user-lk2io1sw6c
@user-lk2io1sw6c 13 дней назад
this is great video. but I still do not understand what to do with this storybook?? in real project we have various UI and we use various component libraries. how storybook is helping in that? what is the use of creating such button.stories.js??
@winter-bear.
@winter-bear. 2 года назад
Hey bro you are excellent person, you are the one with whom i learned coding. #kyle #WebDevSimplified
@jotasenator
@jotasenator 2 года назад
the same here, a year ago
@winter-bear.
@winter-bear. 2 года назад
@@jotasenator yeah he is excellent
@artonthemind
@artonthemind Год назад
Hey there, Can you do a video on how Storybook uses Design Tokens and interacts with Figma for a bridge between the 2 teams??
@daniamsalem
@daniamsalem 2 года назад
For anyone else wondering what is going on at 13:28 when he's iterating over numberOfChildren. I went into the docs and also tested it on the console to figure. it out: 1. defaultValue is just a standard field built into Storybook and is used as a key for a value: storybook.js.org/docs/react/api/argtypes#gatsby-focus-wrapper 2. Starting from the outside, he's spreading values into an array, that's the brackets and the 3 periods aka [...] 3. The values he's spreading into the array above come from the Array(numberofChildren).keys(). I'll explain in two parts. Part 1: we've got an empty array created with a maximum limit of 4 values, that's Array(numberOfChildren) Part 2: that array is then counted out using the keys() function. As stated in MDN, this function returns "An array of strings that represent all the enumerable properties of the given object." Since the array returned from Part 1 was empty, this just counts out the number of indexes (0, 1, 2, 3). 4. As a result, this expression [...Array(numberOfChildren).keys()] returns an array that is [0, 1, 2, 3] 5. When he iterates over it that, the values being passed as "n" are 0, 1, 2, and 3. That explains why he adds a 1 to each value within the brackets {n + 1} Hope that helps!
@yerkoacuna5037
@yerkoacuna5037 2 года назад
Hey, sorry can you help me with a problem related to this? Im trying to do exactly the same as the example of the wrapper component with the argTypes numberOfChildren, but with TypeScript. The problem is that i cannot pass numberOfChildren to my template function throwing an error which says "numberOfChildren does not exist in (my component props)"... And indeed thats true, but thats the point of this example, to use an argtypes that originally does not exist in the component props. I don't know what i'm doing wrong and because i'm new to TS I also don't know how to specify the correct StoryBook Type for fix the error because is not inferring the argtype automatically and after digging in the docs / stack / google for hours im still stuck in this because all the examples that i find with TS only cover the case that the argType exist in the component props. Thanks.
@thedevguild7525
@thedevguild7525 Год назад
Omg, I didn't catch it at first. You rocks! Thanks for the explanation.
@VacaAlpha
@VacaAlpha Год назад
@@yerkoacuna5037 have you solved it? Im curious about how to fix it, maybe creating an interface and passing it to the object?
@vedantthombare1028
@vedantthombare1028 2 года назад
This guy is defeating Dev Ed too
@XiagraBalls
@XiagraBalls 2 года назад
Hmm. I'm trying to do something a bit more complex, I think. I'm trying to create a story for a component which has an parent wrapper. The component itself takes an 'intl' prop which is a complex object (containing functions for formatting currencies, e.g.) and this is dependent on having access to the provider component. Trying to ignore this requirement just leads to an error in Storybook saying the component I'm trying to render needs this provider wrapper. Erm....
@FADHsquared
@FADHsquared 2 года назад
Now this is interesting
@mfpears
@mfpears 2 года назад
Makes more sense to put the story file right next to the component
@pepesabe
@pepesabe 6 месяцев назад
CAN YOU MAKE ANOTHER ONE LIKE THIS BUT USING VITE, (not deprecated CRA)? im struggling changing buttons sizes on the browser, it doesnt function
@hackynawhat
@hackynawhat 2 года назад
Please, tutorial for backend development
@sergeykahnwald6640
@sergeykahnwald6640 Год назад
Storybook is a cool package) But there are some cases when we don’t need all the power of storybook, but just a simple “test page” with all our components where we can play with its props. There is one package that works just fine for this, called storybox-react
@zayne-sarutobi
@zayne-sarutobi 6 месяцев назад
🤲🤲
@markshinkai598
@markshinkai598 2 года назад
this is so informative, but also this is the first time I'm using the playback of slowmo in youtube cause sometimes you talk so fast, otherwise super great video!
@janakachamith1274
@janakachamith1274 2 года назад
can you do a video about how we can hide accesstokens in client side
@supritbeck
@supritbeck 2 года назад
can you make a video on how to use webpack with react.
@DuyTran-ss4lu
@DuyTran-ss4lu Год назад
Awesome
@DarrenbyDesign
@DarrenbyDesign 2 года назад
Any tips on getting this working in Angular?
@hassanm90
@hassanm90 2 года назад
How do we actually use these components in a project?
@davidmarom3861
@davidmarom3861 Год назад
How do I import the components into my project after I'm done preparing them in a storybook project?
@naveeng2003
@naveeng2003 Год назад
How can we type the advanced example shown in TypeScript, when i tried to add numberOfChildren ts yells
@chesterxp508
@chesterxp508 2 года назад
GoodJob!
@brianevans4
@brianevans4 2 года назад
I always thought propTypes was just referring to a typescript interface/type. Didn't realize it could be used in js
@321123580
@321123580 2 года назад
Is it possible to store custom hooks in storybook?
@michaelodonovan6989
@michaelodonovan6989 Год назад
I like this guy, he's quite realistic for an alien lizard.
@rajdeepchandra9807
@rajdeepchandra9807 Год назад
How can we create one for a higher order component?
@croanna_
@croanna_ 6 месяцев назад
I get SyntaxError: Unexpected token '
@ianpogi5
@ianpogi5 2 года назад
Thank you very much for the tutorial but what is the purpose of this? Can these components be imported to another react project so it can be used?
@pb9405
@pb9405 Год назад
Yes, you can for example use this to make a component library and export it as a npm package. Then in another project you can import your component library and use the components.
@paulbrown6792
@paulbrown6792 2 года назад
Nice Jackson ;)
Далее
How To Actually Get Hired In 2024
10:43
Просмотров 186 тыс.
Why Signals Are Better Than React Hooks
16:30
Просмотров 444 тыс.
React Testing Crash Course
58:36
Просмотров 311 тыс.
Начало работы со StoryBook
23:42
Просмотров 46 тыс.
Speed Up Your React Apps With Code Splitting
16:50
Просмотров 363 тыс.
Storybook 7 Crash Course - React Typescript
28:23
Просмотров 38 тыс.
How to Integrate Figma Design Systems with Storybook
8:33
Storybook in 100 Seconds
2:19
Просмотров 450 тыс.