Documentation Index
Fetch the complete documentation index at: https://docs.ollie.shop/llms.txt
Use this file to discover all available pages before exploring further.
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
Prerequisites
- The Ollie Shop CLI installed (
npm install -g @ollie-shop/cli) — see Installation - A scaffolded project (
npx create-ollie-shop) — see the Quickstart - 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
Create the folder
Inside your project, create
components/FreeShippingBar/ with an index.tsx
and a meta.json:Add meta.json
meta.json tells the tooling where the component goes. The slot is where it
renders in the checkout (see Slots). Leave id
out for local development — an unlinked component gets a temporary studio-*
id until you register it.meta.json
Build the Component
Createcomponents/FreeShippingBar/index.tsx:
index.tsx
Add Styles
Createcomponents/FreeShippingBar/styles.module.css:
styles.module.css
Test Locally
Start the local dev server from your project root:Register & Deploy
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:
Deploy
Deploy bundles the local
components/FreeShippingBar folder and uploads it to
the builder. Pass the component id from the previous step and the folder name:--wait polls until the build finishes.Using Checkout Data
The SDK exposes hooks for reading checkout data.useCheckoutSession returns the
parsed session:
CheckoutSession type for the full shape.
Adding Interactivity
Cart changes go throughuseCheckoutAction,
not useCheckoutSession:
Best Practices
Performance
Error Handling
Surface failures to the user viauseMessages:
Accessibility
Next Steps
Custom Component 101
A fully custom CartItem walkthrough
API Reference
Complete SDK documentation