suiss/uim · Block

Grid Accessories

A two-column accessories grid with category chips and add to bag buttons that update a bag count.

Grid Accessories 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
Grid Accessories on iOS in light mode

Composes Screen, Chip filters, Button, Icon and Text. Category chips filter the grid, and each card's plus button expands into an In bag state while a badge on the bag icon shows the item count.

Installation

$ pnpm dlx @esuiss/uim@latest add grid-accessories

The CLI also adds what it builds on: Button, Chip, Icon, Screen, Text.

Manual

  1. Install the dependencies:
npx expo install cn phosphor-react-native react-native-reanimated react-native-svg react-native-worklets
  1. Add the pieces it builds on: Button, Chip, Icon, Screen, Text.

  2. Copy the source into components/blocks/grid-accessories.tsx:

uniwind/components/blocks/grid-accessories.tsx
import { cn } from "cn"
import { CheckIcon, HandbagIcon, PlusIcon } from "phosphor-react-native"
import * as React from "react"
import { Image, ScrollView, View } from "react-native"
import {
  Easing,
  FadeInDown,
  ReduceMotion,
  useAnimatedStyle,
  useSharedValue,
  withTiming,
  ZoomIn,
} from "react-native-reanimated"
import { AnimatedView } from "@/components/ui/animated-view"
import { Button } from "@/components/ui/button"
import { Chip, ChipGroup } from "@/components/ui/chip"
  1. Update the import paths to match your project.

Usage

import { GridAccessories } from "@/components/blocks/grid-accessories"
<GridAccessories />

Replace ACCESSORIES and FILTERS with your catalog. Pass onAddToBag, onRemoveFromBag and onFilterChange to sync with your cart.