Creating new component variants

Creating new variants allows you to extend the shadcn/ui system while maintaining consistency with the existing design language. This guide demonstrates how to add a new "Warning" variant to the Button component in Figma.

Instructions

  1. Ensure that you have added the warning variables as instructed in this lesson.
  2. Navigate to the Button page in the main library file.
  3. Expand the Components section and the Button frame to create more space for new variants.
  4. Select and duplicate the Primary button variants by pressing Ctrl + D (Command + D on Mac). Drag the duplicated buttons to the bottom of the component frame.
  5. In the Button properties panel, rename the newly created variants to Warning.
  6. Change the color variables for the newly created variants from primary to warning.
  7. Change the color variables for the newly created variants from primary-foreground to warning-foreground.
  8. Select the Button component frame.
  9. Run the Propstar plugin to organize the layout and create a component table.
  10. Leave a comment for the developer detailing your changes.
Up next
Creating new components
In this lesson, you will learn how to create a simple Button component. Following these steps to ensures consistency with the shadcn/ui.