suiss/ui · Block
Bag Configure
A product configurator for choosing a model, finish, and storage, with a live price and Add to Bag button.
Bag Configure is an open-source block from suiss/ui for React, React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.
A buy page where shoppers pick a model, a finish and a storage size while the product photo and price update to match. On desktop the photo sits beside the options; on mobile it shrinks to a panel above them, and a sticky footer keeps the price and Add to Bag button in reach. Good for any configurable product, such as hardware, tiered subscriptions or made-to-order goods.
Installation
CLI
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
Manual
-
Add the pieces it builds on: Button, Label, Radio Group, Toggle Group.
-
Copy the source into
components/blocks/bag-configure.tsx:
- Update the import paths to match your project.
Usage
Edit the models, finishes and storage lists: models carry a base price, finishes a swatch color and photo, and storage options a surcharge. The price is the model price plus the storage surcharge, with a 12-month estimate below it. Replace the Add to Bag handler, which only flips a local flag, with your cart call, and update the heading copy.
Notes
Price changes are announced to screen readers, and each swatch is labeled with its finish name. Photos are Unsplash placeholders.

Composes Screen, ToggleGroup color swatches, Button, Text and BottomBar. Model and storage are radio-style options, the finish swatches cross-fade the product photo, and the bottom bar shows the price and a monthly amount that update as you choose. Add to Bag switches its label to Added to Bag.
Installation
The CLI also adds what it builds on: Bottom Bar, Button, Screen, Text, Toggle Group. On React Native it also adds the animated view components/ui/animated-view.tsx.
Manual
- Install the dependencies:
-
Add the pieces it builds on: Bottom Bar, Button, Screen, Text, Toggle Group, and the animated view
components/ui/animated-view.tsxfrom the next step. -
Copy the animated view into
components/ui/animated-view.tsx:
- Copy the source into
components/blocks/bag-configure.tsx:
- Update the import paths to match your project.
- Install the dependencies:
-
Add the pieces it builds on: Bottom Bar, Button, Screen, Text, Toggle Group, and the animated view
components/ui/animated-view.tsxfrom the next step. -
Copy the animated view into
components/ui/animated-view.tsx:
- Copy the source into
components/blocks/bag-configure.tsx:
- Update the import paths to match your project.
- Install the dependencies:
-
Add the pieces it builds on: Bottom Bar, Button, Screen, Text, Toggle Group, and the animated view
components/ui/animated-view.tsxfrom the next step. -
Copy the animated view into
components/ui/animated-view.tsx:
- Copy the source into
components/blocks/bag-configure.tsx:
- Update the import paths to match your project.
-
Target iOS 17 or later.
-
Add the Swift package to your app:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Add the files to your app target.
- Set
minSdkto 24 or higher and add the dependencies:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Update the
com.esuiss.uipackage names to match your project.
Usage
Replace MODELS, FINISHES and STORAGE with your catalog data. Pass onAddToBag to receive the selected model, finish, storage and price.
