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

Описание к видео Tailwind is messy. Make reusable components instead with ReactJS, TailwindCSS, & TypeScript

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

Комментарии

Информация по комментариям в разработке