Tailwind is messy. Make reusable components instead with ReactJS, TailwindCSS, & TypeScript

Published: 15 October 2023
on channel: Devistry
15,564
549

I love TailwindCSS, but it can create some very messy HTML code. You can make a massive improjevent by reusing your common elements as a component. This video shows you how you can build your own library of reusable components.

00:00 Intro
03:05 Creating a component
04:05 Using the children prop
05:50 Passing button attributes (onClick, etc)
10:18 Overriding styles with twMerge
14:45 Component variants with class-variance-authority
22:38 cn() utility function
24:10 Passing variant props
27:16 Outro


Watch video Tailwind is messy. Make reusable components instead with ReactJS, TailwindCSS, & TypeScript online without registration, duration hours minute second in high quality. This video was added by user Devistry 15 October 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 15,564 once and liked it 549 people.