Skip to main content

Overview

This guide walks through building a free shipping progress bar component. You’ll learn how to:
  • Create a component in your project
  • Access checkout data with the SDK
  • Run it locally
  • Register and deploy it to your store
Let your agent build it. The Ollie Shop skill ships with projects created by npx create-ollie-shop, and it carries an opinionated recipe for this exact component.
Prompt
It covers the rest of this guide too, one step at a time:
  • Access checkout data with the SDK: Which session fields do I need for a free shipping bar?
  • Run it locally: Start the dev server and show me the component in Studio.
  • Register and deploy it: Register this component in my store and deploy it.
Working through the walkthrough below teaches you what the agent is doing, which is worth doing once. After that, the prompts are faster.Don’t have the skill yet? Install it.

Prerequisites

  • A scaffolded project (npx create-ollie-shop), see the Quickstart. It installs the Ollie Shop CLI as a dev dependency, so npx ollieshop ... works from the project root. A global install (see Installation) is optional.
  • Basic React knowledge
  • Access to a store
A component is a folder under components/ in your project. It is not a standalone package: ollieshop component create only registers metadata in the database; it does not scaffold a folder. The actual code lives in your project.

Create the Component

1

Create the folder

Inside your project, create components/FreeShippingBar/ with an index.tsx:
2

Declare it in ollie.json

The components map in ollie.json tells the tooling which folders are components and where each one renders. The key is a local alias, path is the folder, and slot is the slot id in the checkout (see Slots). cart_header_full_page renders above the cart content and is empty by default, which makes it a good first slot.
ollie.json
There is no id yet, so the component is unlinked: the dev server gives it a temporary studio-FreeShippingBar id until you register it. A folder under components/ with no entry in the map is still discovered, but without a slot it is built and not placed anywhere in the checkout.
Older projects used a meta.json file inside each component folder. The CLI still reads it as a fallback, and npx ollieshop setup migrates those files into the ollie.json map.

Build the Component

Create components/FreeShippingBar/index.tsx:
index.tsx

Add Styles

Create components/FreeShippingBar/styles.module.css:
styles.module.css

Test Locally

Start the local dev server from your project root:
This discovers your components, opens Ollie Studio in the browser, and hot-reloads as you edit.

Register & Deploy

The quickest route is Studio: open the component’s card, confirm the slot, and click Publish. Studio creates the component record, deploys the build, and writes the new id into ollie.json for you. The steps below do the same thing from the terminal.
1

Register the component

Create the component record in a store version to get its component id. You can do this in the admin dashboard, or via the CLI:
2

Link the folder to the id

component create does not touch your project files. Replace the alias in ollie.json with the id it returned, so the folder is linked from now on:
ollie.json
3

Deploy

Deploy bundles the local components/FreeShippingBar folder and uploads it to the builder. Pass the component id and the folder name:
--wait polls until the build finishes.
4

Verify

Using Checkout Data

The SDK exposes hooks for reading checkout data. useCheckoutSession returns the parsed session:
See the hooks reference and the CheckoutSession type for the full shape.

Adding Interactivity

Cart changes go through useCheckoutAction, not useCheckoutSession:

Best Practices

Performance

Error Handling

Surface failures to the user via useMessages:

Accessibility

Next Steps

Custom Component 101

A fully custom CartItem walkthrough

API Reference

Complete SDK documentation