suiss/ui ยท Block
Nav Categories
A store landing header with a draggable carousel of category tiles and a heading that follows the selection.
Nav Categories 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 store landing header with a Store heading and tagline beside quick help links, then a draggable row of image tiles for each category. Selecting a tile lifts it and updates the line below to name the category. Use it as the top of a shop home page or any visual category picker.
Replace categories with your categories, each with a label and image. Tiles only select themselves, so navigate or load products from the Toggle's onPressedChange. Point the #specialist and #stores links at your routes.
Tile images are decorative, so each tile is named by its label. Images are Unsplash placeholders.
Installation
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
Usage
Web preview
A store screen with a large heading, links to ask a specialist or find a store, and a scrollable ChipGroup of categories, each Chip showing a photo and a label. Selecting a category updates the line below it.
Replace CATEGORIES with your categories and images. Wire onSelectCategory, onAskSpecialist and onFindStore to your navigation. The photos are Unsplash placeholders.
Installation
- Install the following dependencies:
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/nav-categories.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/nav-categories.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/nav-categories.tsx:
- Update the import paths to match your project setup.
-
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.
- Apply the Compose compiler plugin, enable Compose, set
compileSdkto 37 or higher andminSdkto 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.