Webflow Components

Component Variants

Overview
Component Data Binding
Component Slots
201
Component Variants
201
Shared Component Libraries
Shared Component Libraries
601
Shared Library Pro-Tips
604
Advanced Components
Custom Code in Shared Lib Components
901
Component Property to Variable Binding
902
No items found.
Published
March 10, 2025
Updated
in lightbox

Component variants allow you to create distinctly stylized versions of a component.

This is achieved by creating a Variant on the component itself, and then all elements within the component can be style-adjusted when that Variant is selected.

Example Use Cases

  • A section component which head a heading, and a big slot for content. Variant can be used to control how the slot works, e.g flex vertical, grid 3 columns, and so on. This makes it easy to reuse that same section for diffrent layouts.

Useful Tips

You can only specify one variant per component, therefore it's most effective to make the components "small" and to use nesting and slots in order to create more complex arrangements.

For example, a modal component might consist of;

  • The modal itself
  • Sidebar content
  • Main content
  • Buttons

Variants allow you to make key decisions, like...

  • Where the modal is positioned - center, bottom left, etc.
  • Whether the button has an icon or not, or perhaps the background color of the button

FAQs

Answers to frequently asked questions.

Videos
No items found.
Table of Contents
Comments
Did we just make your life better?
Passion drives our long hours and late nights supporting the Webflow community. Click the button to show your love.