While you can always build your own custom component, sometimes a component is most of the way there, and you just need a little customization to work for your site. In that case, you may want to extend a component that came with your site, rather than starting from scratch.

When to Extend a Component

There are a few common scenarios for extending Stackbit components:

  • Making stylistic changes.
  • Surfacing style options to content editors.
  • Structurally changing a component by adding or removing properties.

If the component you're looking to create is stylistically or structurally different from an existing component in any significant way, it's likely best that you look into building your own component.

Duplicating as an Alternative

Alternatively, instead of directly extending a component, you could also use any component as a starting point for a new component, adjusting what is necessary along the way.

To achieve this, locate the component you want to duplicate, copy the code, and then following the custom component guide from there.

Extending Component Scenario Guides

The following guides will help you through the process of extending a Stackbit component.