suiss/uim · Block

Grid Lineup

A product lineup in two columns, each model with finish swatches, a tagline, a price and Buy and Learn more actions.

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

Composes Screen, ToggleGroup color swatches, Button and Text. Each model keeps its own selected finish, which is passed along when Buy is pressed.

Installation

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

The CLI also adds what it builds on: 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: Button, Screen, Text, Toggle Group.

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

uniwind/components/blocks/grid-lineup.tsx
import { cn } from "cn"
import * as React from "react"
import { Image, Pressable, ScrollView, View } from "react-native"
import { FadeInDown, ReduceMotion } from "react-native-reanimated"
import { AnimatedView } from "@/components/ui/animated-view"
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"

const photo = (id: string) =>
  `https://images.unsplash.com/photo-${id}?w=600&q=80&auto=format&fit=crop`

type Finish = { label: string; swatch: string }

type Model = {
  1. Update the import paths to match your project.

Usage

import { GridLineup } from "@/components/blocks/grid-lineup"
<GridLineup />

Replace MODELS with your lineup. Pass onBuy to receive the model name and finish, and onLearnMore for the Learn more link.