suiss/uim · Block

Bag Configure

A product configuration screen for choosing a model, finish and storage, with a live price and an Add to Bag button.

Bag Configure is an open-source mobile screen from suiss/uim for React Native and Expo, with SwiftUI and Jetpack Compose versions built from the same design tokens. The @esuiss/uim CLI copies its source into your project, so you own the code.

iOS
Bag Configure on iOS in light mode

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

$ pnpm dlx @esuiss/uim@latest add bag-configure

The CLI also adds what it builds on: Bottom Bar, Button, Screen, Text, Toggle Group.

Manual

  1. Install the dependencies:
npx expo install cn react-native-reanimated react-native-worklets
  1. Add the pieces it builds on: Bottom Bar, Button, Screen, Text, Toggle Group.

  2. Copy the source into components/blocks/bag-configure.tsx:

uniwind/components/blocks/bag-configure.tsx
import { cn } from "cn"
import * as React from "react"
import { Image, Pressable, ScrollView, View } from "react-native"
import {
  Easing,
  ReduceMotion,
  useAnimatedStyle,
  useSharedValue,
  withTiming,
} from "react-native-reanimated"
import { AnimatedView } from "@/components/ui/animated-view"
import { BottomBar, BottomBarContent } from "@/components/ui/bottom-bar"
import { Button } from "@/components/ui/button"
import { Screen } from "@/components/ui/screen"
import { Text } from "@/components/ui/text"
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"
  1. Update the import paths to match your project.

Usage

import { BagConfigure } from "@/components/blocks/bag-configure"
<BagConfigure />

Replace MODELS, FINISHES and STORAGE with your catalog data. Pass onAddToBag to receive the selected model, finish, storage and price.