Authoring Components with CVA + tailwindcss - Icon Buttons (3 / 4)

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 มิ.ย. 2024
  • CVA (class-variance-authority) is an incredibly simple, yet powerful library for creating typed variants out of regular ol' css classes. This series walks through how to leverage CVA with tailwindcss to author a Button component in React.
    In this video we will add icons to the Button component, as well as create an IconButton component.
    Feel free to follow along or checkout the code for yourself: github.com/brookslybrand/cva-...
    00:00 Introduction
    00:37 Leading and trailing icons
    08:37 "Private" variants
    11:59 Creating an IconButton component
    15:17 Icons and screen readers
    17:07 Final tweaks

ความคิดเห็น • 1

  • @RootsMj
    @RootsMj 6 หลายเดือนก่อน

    Nice example to show discriminating union! I learned something new!