Cart components
Components for cart functionality including the drawer, item display, and checkout.
Cart button
Open the cart drawer and show the current item count. Typically placed in your site header.
Properties
Property | Type | Description |
|---|---|---|
Show count | Boolean | Display item count badge |
Icon | Slot | Custom cart icon |
Cart target | Component reference | Which cart modal to open |
How it works
Canvas: Shows the button with a static count (or "0") for layout purposes.
Live site: Subscribes to the TGC cart state. Count updates in real-time when items are added or removed.
Basic usage
Drag Cart button into your header or navbar
Enable Show count to display the badge
Connect Cart target to your Cart modal section
When clicked, the button opens the cart drawer/modal.
Count badge
The badge shows the total number of items in the cart (not unique products).
Cart contents | Badge shows |
|---|---|
Empty | Hidden or "0" (configurable) |
1 shirt (qty 1) | 1 |
1 shirt (qty 3) | 3 |
2 products (qty 5 total) | 5 |
Custom icon
Use the Icon slot to replace the default cart icon with your own:
Select the Cart button
In the layers panel, find the Icon slot
Replace with any Framer component or SVG
Styling
Element | What to style |
|---|---|
Button | Background, border, padding |
Icon | Size, colour |
Badge | Background, text colour, size, position |
Hover state | Background, icon colour |
Cart list
Container for cart items inside the cart drawer. Repeats the Cart item template for each product.
Properties
Property | Type | Description |
|---|---|---|
Empty state | Slot | Content shown when cart is empty |
Item template | Slot | Template for each cart item |
How it works
Canvas: Shows placeholder items for layout purposes.
Live site: Subscribes to the TGC cart state. Renders one Cart item for each product in the cart. Updates automatically when items are added, removed, or quantities change.
Basic usage
Inside your cart modal/drawer, drag in Cart list
The Item template slot contains a Cart item component
Customise the Cart item's layout and styling
Design the Empty state for when the cart has no items
Empty state
The empty state appears when the cart has no items. Design it to:
Inform the customer the cart is empty
Encourage them to continue shopping
Optionally include a link back to your shop page
Example: "Your cart is empty. [Continue shopping]"
Scrolling behaviour
For carts with many items, wrap the Cart list in a scrollable container:
Set a max-height on the Cart list container
Set overflow to "scroll" or "auto"
The list scrolls while header/footer (subtotal, checkout) stay fixed
Styling
Element | What to style |
|---|---|
Container | Padding, max-height, overflow |
Empty state | Typography, spacing, link styling |
Gap between items | Spacing property on the list |
Cart item
Individual item display within the cart list. Shows product image, title, variant, price, and quantity controls.
Properties
Property | Type | Description |
|---|---|---|
Show image | Boolean | Display product thumbnail |
Show variant | Boolean | Display selected variant (e.g., "Size: M") |
Show quantity controls | Boolean | Enable +/- buttons to adjust quantity |
Show remove button | Boolean | Show button to remove item from cart |
How it works
Canvas: Shows placeholder data for layout purposes.
Live site: Receives item data from the parent Cart list. Displays real product info and handles quantity updates and removal.
Basic usage
Cart item is used inside Cart list as the item template. You don't drag it separately — it's already included.
To customise:
Select the Cart list component
In the layers panel, expand to find the Cart item template
Rearrange and style the elements
Displayed information
Element | Source |
|---|---|
Image | Product's main image from Swell |
Title | Product name |
Variant | Selected options (e.g., "Blue / Large") |
Price | Line item price (unit price × quantity) |
Quantity | Current quantity in cart |
Quantity controls
When enabled, the +/- buttons allow customers to adjust quantity without leaving the cart:
+ increases quantity by 1
- decreases quantity by 1 (minimum 1)
Hitting 0 removes the item (or use the remove button)
Quantity changes update the cart total and Subtotal immediately.
Remove button
The remove button deletes the item from the cart entirely. Consider styling it as:
A small "×" icon
A trash icon
A text link ("Remove")
Styling
Element | What to style |
|---|---|
Container | Layout (row/column), padding, border |
Image | Size, border radius, aspect ratio |
Title | Font, size, colour, truncation |
Variant text | Font, size, muted colour |
Price | Font, weight, colour |
Quantity controls | Button styling, size, spacing |
Remove button | Icon/text, colour, hover state |
Subtotal
Display the cart total. Typically placed above the checkout button in the cart drawer.
Properties
Property | Type | Description |
|---|---|---|
Label | String | Text before amount (default: "Subtotal") |
Currency symbol | String | e.g., "$", "£", "€" |
Currency position | Enum | "Before" or "After" the amount |
Show item count | Boolean | Display number of items alongside total |
How it works
Canvas: Shows a placeholder amount for layout purposes.
Live site: Subscribes to the TGC cart state. Calculates and displays the sum of all line items. Updates instantly when cart changes.
Basic usage
Inside your cart modal/drawer, drag Subtotal below the Cart list
Configure your currency symbol
Optionally enable Show item count
What's included in the subtotal
The subtotal shows the sum of all line items (quantity × price for each item).
It does not include:
Shipping (calculated at checkout)
Tax (calculated at checkout)
Discounts (applied at checkout)
These are handled by Swell's hosted checkout.
Item count
When Show item count is enabled, display format options:
Format | Example |
|---|---|
Count only | "3 items" |
With label | "Subtotal (3 items)" |
Separate line | "3 items" on one line, "$150.00" on another |
Styling
Element | What to style |
|---|---|
Container | Layout, spacing |
Label | Font, size, colour |
Amount | Font, size, weight, colour |
Item count | Font, size, muted colour |
Checkout button
Redirect customers to Swell's hosted checkout to complete their purchase.
Properties
Property | Type | Description |
|---|---|---|
Label | String | Button text (default: "Checkout") |
Loading label | String | Text while processing (default: "Redirecting...") |
Disabled when empty | Boolean | Disable button when cart is empty |
How it works
Canvas: Shows the button label for layout purposes.
Live site: When clicked, creates a checkout session in Swell and redirects the customer to Swell's hosted checkout page.
Basic usage
Inside your cart modal/drawer, drag Checkout button below the Subtotal
Customise the label if needed
Enable Disabled when empty to prevent checkout with no items
Checkout flow
When the customer clicks Checkout:
Button shows loading state
TGC sends cart contents to Swell
Swell creates a checkout session
Customer is redirected to Swell's hosted checkout
Customer completes payment on Swell
Swell handles order confirmation and redirect
Why hosted checkout?
Swell's hosted checkout handles:
PCI compliance for payment processing
Shipping calculations
Tax calculations
Discount/coupon codes
Order creation and confirmation
This means you don't need to build checkout forms or handle sensitive payment data.
Customising checkout
The hosted checkout uses Swell's default styling. For brand consistency, you can customise checkout in your Swell dashboard under Settings → Checkout.
For full checkout control within Framer, see The Good Checkout (coming soon).
Styling
Element | What to style |
|---|---|
Button | Background, border, padding, font |
Hover state | Background, border colour |
Loading state | Opacity, cursor |
Disabled state | Background, opacity |