Use components to manage recurring layouts and content more efficiently across your site.
Components give you the power to create customizable blocks of elements and child elements to maintain a consistent, efficient, and scalable design workflow. You can reuse those blocks across your site and modify them in a single place to avoid individually revising each recurring layout.
-
Identical content and design per instance — create a component for recurring layouts (e.g., navbars and footers) to reuse across your site. Any changes to the content or design automatically update every instance of the component.
-
Unique content per instance — create a component with a consistent layout and design, but allow each instance to have different content, (e.g., a hero section layout that can have unique text, images, or videos per instance) using component properties and slots.
-
Different variants per instance — create a component with predefined style and layout options, (e.g., solid and outline buttons, or horizontal and vertical card layouts). Component variants let you customize the design of each instance without needing to create separate components.
Component terminology
Main component — The component definition, including structure, styles, and configurability. Changes to the main component impact every instance of that component.
Component instance — An individual references to a main component. Each instance can have unique content and settings via props and slots, but structure and styles can only be edited on the main component.
Variant — You can create variants of a component with different layouts, colors, font styles etc. (e.g., solid or outline buttons, or horizontal and vertical card layouts) and choose which which variant to use on each instance of your component across your site.
Properties (props) — Component properties let you define specific elements within a component that can be modified with unique values on a component instance.
Slots — Elements you can place in existing components that act as placeholders for other components.
Designing components
Webflow supports designing the main component both in context, and on a dedicated component canvas.
-
In-context — Designing a main component in the context of a component instance (e.g., on a page).
-
Component Canvas — Designing a main component (and component variants) outside the page, with all variants visible side-by-side.
How to create a component
You can create a component from existing elements or from scratch.
Create a component from an existing element
Any elements on the canvas can be converted to a component for reuse across your site. To convert existing elements to a component:
- Select the element you want to convert to a component
- Open the Component panel or press Command + Shift + A (on Mac) or Control + Shift + A (on Windows)
- This is also available from the Style panel and Settings panel
- Click the “new component” icon at the top of the panel
- Choose Convert selection (for creating a new component from selected elements)
- Give your component a name
- (Optional) Add your component to a group and give it a description
- (Optional) If suggested props are available:
- Click the expand icon to review them
- Click the pencil icon to rename a prop
- Deselect any props you don’t want to create
- Click Create
Duplicate a component
- Open the Components panel
- Click the “more options” icon
- Click Duplicate
- Give your component a name
- (Optional) Add your component to a group and give it a description
- Click Create
Create a component from scratch
You can build components from scratch on the Component Canvas — a dedicated space for creating and editing components outside the context of a page. This is especially useful for components that’ll have multiple variants. To create a component from scratch:
- Open the Components panel
- Click the “new component” icon at the top of the panel
- Choose Create blank
- Give your component a name
- (Optional) Add your component to a group and give it a description
- Click Create
After you click create, the Component Canvas opens with a single empty div block — this is the wrapper for your component. From here you can build your component's responsive layout, add content and interactions, and create variants. To exit the Component Canvas, click the “back” arrow next to your component’s name in the top bar.
How to use and reuse a component
Once you’ve created a component, you can reuse it anywhere on your site:
- Open the Components panel
- Hover over a component to view a preview
- Drag and drop the component onto the canvas or Navigator
When you select a component instance, you’ll see it highlighted and outlined in green. Open the Components panel to see how many times each of your components has been used in your site.
Note
Duplicating a component instance is possible (i.e., duplicating via copy and paste, right-clicking, or by using keyboard shortcuts), but duplicating a main component is not natively possible at this time. Instead, you can unlink the component instance and create a new component from that unlinked element or group of elements.
To view a component’s element hierarchy in the Navigator panel, Hold Option + double-click (on Mac) or Hold Alt + double-click (on Windows) the component, or click the “edit main component” icon. You’ll only be able to see the component’s element hierarchy from the main component (i.e., you won’t be able to view the component’s element hierarchy from within a component instance).
How to edit a component
Let’s go through the various ways you can interact with and edit a component:
- Edit the main component
- Component props, slots, and style variants
- Create component style variants
- Manage the variant prop
- Change a component instance’s variant
- Reorder, rename, duplicate, or delete component style variants
- Exit the main component
- Edit components in the Editor
- Change a component name or description
- Group components
- Delete a component
Edit the main component
Edits to the main component will affect every component instance (unless that component instance has component properties applied to specific elements within the component). You can edit the main component either in-context (from an instance on a page) or on the Component Canvas.
Edits to the main component will affect every component instance (unless that component instance has component properties applied to specific elements within the component). When editing the main component, you can change the structure and element order to simultaneously affect all component instances across your site.
Edit the main component in-context
You can edit the main component from any component instance by:
- Double-clicking the component instance on the canvas or in the Navigator
- Hovering over the component instance in the Navigator and clicking the “edit component” icon
- Right-clicking the instance and clicking Edit component
- Selecting the instance and clicking the “edit component” icon in the label
- Selecting the instance and clicking the “edit component” icon at the top of the right panel
Open the main component on the Component Canvas
To edit the main component on the Component Canvas:
- Open the Components panel
- Hover over the component you want to edit
- Click the “open component” icon
You can also edit the main component on the Component Canvas by right-clicking an instance on the canvas and clicking Open component. To navigate from in-context editing, use the green banner.
Component props, slots, and variants
Component properties (props), slots, and style variants let you create unique configurations on each instance of a component:
-
Props — connect individual element settings in the main component (e.g., text, links, images, or videos) to props. This allows you to customize these settings on each instance without changing the overall structure or design of the component. Props can also be connected to CMS fields to dynamically pull in content from your CMS Collections.
-
Slots — slots are elements you can place in existing components that act as placeholders for other components. This lets you build components modularly, where each instance can include different components in the slot. Slots offer more flexibility and versatility, enabling you to design dynamic and reusable layouts.
-
Variants — define multiple design options for a single component, allowing you to adapt its appearance for different use cases. For example, you can offer variants like solid or outline buttons, or horizontal and vertical card layouts, so each instance of the component fits its context without creating entirely new components.
Create component style variants
You can create variants of a component with different layouts, colors, font styles etc. (e.g., solid or outline buttons, or horizontal and vertical card layouts) and choose which which variant to use on each instance of your component across your site.
To create a component style variant:
- Edit the main component
- In the Navigator, click the “plus” icon next to Variants
- Click the “plus” icon
- Give the variant a unique name
- Press the Enter/Return key on your keyboard to confirm
You can also add component variants on the Component Canvas by clicking the “+ Variant” button, or manage variants from the Style panel.
All variants inherit their styles from the base variant. You can adjust the styles on any element within the component without affecting the base variant.
Pro tip
Components can only have a single variant property (with no limit to the number of variants). For more advanced use cases, you can use the class custom attribute.
Manage the variant prop
When you create a component style variant, a variant prop is automatically created for that component. You can change the variant prop’s name, add it to a property group, and set a default variant for the component in the Properties panel.
To change the name of the variant prop:
- Edit the main component
- Click the “Properties” icon in the left toolbar or press K on your keyboard to open the Properties panel
- Click the Variant property
- Enter a unique property name
- Press the Return key on your keyboard to confirm
To add the variant prop to a property group:
- Edit the main component
- Click the “Properties” icon in the left toolbar or press K on your keyboard to open the Properties panel
- Click the Variant property
- Select a group or enter a unique name to create a new group
- Click Create or press the Return key on your keyboard to confirm
Learn more about component property groups.
Set a default variant for a component:
- Edit the main component
- Click the “Properties” icon in the left toolbar or press K on your keyboard to open the Properties panel
- Click the Variant property
- Choose a variant from the Defaults dropdown
Change a component instance’s variant
Like other component properties, you can choose the style variant for each instance of a component. To change a component instance’s variant:
- Single-click the component to open the instance’s Properties panel
- Choose the variant for this instance from the Variants dropdown
Reorder, rename, duplicate, or delete component style variants
Designers can manage component style variants (e.g., reorder, rename, duplicate, or delete variants).
To reorder a component’s variants:
- Edit the main component
- Open the Navigator
- Click and drag a variant to move it to a new position
When you reorder component variants, their frames are automatically reordered on the Component Canvas also.
To rename a variant:
- Edit the main component
- Open the Navigator
- Double-click the variant name
- Enter a new, unique variant name
- Press the Enter/Return key on your keyboard to confirm
To duplicate a variant:
- Edit the main component
- Open the Navigator
- Hover over the variant and click the “more options” icon
- Click Duplicate
- Enter a unique variant name
- Press the Enter/Return key on your keyboard to confirm
To delete a variant:
- Edit the main component
- Open the Navigator
- Hover over the variant and click the “more options” icon
- Click Delete
- Click Delete in the pop-up modal to confirm
Note that the base variant can’t be deleted.
Important
When a component style variant is deleted, all component instances using the deleted variant will automatically revert to the default variant.
Exit the main component
Once you’re done editing the main component, you’ll need to exit the in-context editing view or Component Canvas to continue working on the rest of your site. To exit the main component, click the “back” arrow next to your component’s name in the top bar.
When editing in-context, you can also exit the main component by clicking outside the component on the canvas or pressing Escape on your keyboard.
After you’ve stopped editing the main component, keep in mind that any edits you make to elements in a component instance will only affect that specific component instance.
Change a component name, group, or description
To change a component name or description:
- Open the Components panel or click the component name in the top bar while editing the component
- Hover over a component name and click the “more options” dots that appear
- Click Edit settings
- Make your changes and Save
To change a component group, choose an existing group from the Group dropdown, or type to create a new group
Rename a component instance
You can rename individual component instances to make them easier to identify — this is especially helpful when reusing the same component multiple times on a page. Custom names appear and can be edited in the Navigator, at the top of the right panel, and on the canvas when the instance is selected.
To rename a component instance:
In the Navigator or at the top of the right panel:
- Double-click the component name
- Type the new name
- Press Enter or click away to save your custom name
On the canvas:
- Right-click the component instance
- Click Rename
- Type the new name
- Press Enter or click away to save your custom name
To reset the name back to the original component name, delete the custom name during renaming or right-click the instance in the Navigator or on the canvas and click Reset name.
Note: Renaming a component instance doesn’t affect the main component or other instances. To view an instance’s original name, Hold Option (on Mac) or Hold Alt (on Windows) in the Navigator, or hover over the custom name at the top of the right panel.
Learn more about renaming elements and component instances.
Delete a component
Note that you can only delete a component with zero instances. To delete a component completely:
- Remove or unlink all instances of the component from your site
- Open the Components panel
- Hover over a component name and click the “more options” dots that appear
- Choose Edit settings
- Click Delete and confirm
How to unlink a component instance from its main component
To unlink a component instance and make changes to it independent of the main component:
- Right-click any component element in the instance you want to unlink
- Click Unlink instance
Once unlinked, if you edit any other linked instance of that component in your design, it will not change the unlinked instance.
Sharing native and code components across sites with Libraries
You can share native and code components across sites in a Workspace with Libraries. This can accelerate your workflow and enhance your design system by providing a single place to update components that are used across multiples sites in your Workspace.