Most of the cart templates are overridable. You can also override the CSS for aesthetic changes.

Getting started

When including Snipcart, you have to create an element to mount the cart on.

<!-- Snipcart stylesheet -->
<link rel="stylesheet" href="" />

<!-- Element where you set your API key and insert your custom templates -->
<div id="snipcart" data-api-key="<API_KEY>">

<!-- Snipcart script -->
<script src=""></script>

In this element, you can provide your own templates. Refer to this documentation entry to see the list of components. Every component that has a Default Template can be overridden.

To override a template, insert a node into div#snipcart. The node tag must be the name of the component you want to override.

<div hidden id="snipcart" data-api-key="<API_KEY>">
        <!-- The template must have a single root element -->
        <div class="root">

You must provide a root node for each component you override. For instance, this wouldn't be valid:

<div hidden id="snipcart" data-api-key="<API_KEY>">
        <!-- You can't have more than one root element in your template. -->
        <div class="root">
        <div class="root">


Some sections in the cart are also overridable. This allows you to add any element in specific sections of the cart without requiring a full override. This can be useful when you only want to add a custom notice or a custom field.

The key here is to specify which section you want to override beside the component name:

<div hidden id="snipcart" data-api-key="<API_KEY>">
    <!-- Specify the section name with section attribute -->
    <component-to-override section="top">
        <div class="root">
            This will be inserted into the section named `top`.

You can take a look at this documentation entry to see all overridable sections.

How it works

Under the hood, the cart is built with Vue.js. So Vue directives are supported in your custom templates.

However, you don't need to learn Vue to write your own templates. But if you do know it, you might be able to push things a bit further.

We tried to encapsulate all the logic inside micro-components and component wrappers. That way, it's simpler to understand how a template works without having to know Vue.

However, we kept some Vue directives like v-if and @click in our templates. We considered trying to encapsulate them into component wrappers but realized it would create a lot of useless components, so we decided to keep them in templates.


Here is an example of what can be done with our customizable templates.

Simplify cart items

Let's say you want to update the template of each item in the cart. You want to remove images, descriptions, etc.—keep the bare minimum.

<div hidden id="snipcart" data-api-key="<api_key>">
       <li class="snipcart__item__line snipcart__box">
           <div class="snipcart__item__line__product">
               <div class="snipcart__item__line__header">
                   <h2 class="snipcart__item__line__header__title">
                       {{ }}

                   <item-quantity class="snipcart__item__line__quantity" v-if="!adding"></item-quantity>
                   <div class="snipcart__item__line__header__actions">
                       <remove-item-action class="snipcart__button--icon">
                           <icon name="trash" class="icon--red"  alt="item.remove_item"></icon>


Add phone field in address form

If you want to collect the phone number in the address form, you can add the phone field and the value will appear in the customer info.

<div id="snipcart" data-api-key="<api_key>" hidden>
    <address-fields section="top">
            <snipcart-label for="phone">
                Phone number
            <snipcart-input name="phone">

Phone number custom field


We suggest you take a look at our components reference documentation. You'll find the documentation of each overridable template along with its default template.