Skip to main content
This guide will help you create your first components with Zayne Labs UI. We’ll walk through basic usage patterns and show you how to compose components together.

Setup

1

Install the package

First, install Zayne Labs UI and its peer dependencies:
2

Import components

Import the components you need. Each component is available as a separate module:
3

Start building

Use the components in your app. All components are headless - bring your own styles!

Basic examples

Conditional rendering with Switch

The Switch component provides pattern matching for conditional rendering, similar to a switch statement:

List rendering with For

The For component makes list rendering declarative and handles empty states:

Building a card layout

The Card component provides a composable structure for card-based layouts:

File upload with DropZone

The DropZone component provides a complete file upload solution with drag-and-drop support:

Composing components

Zayne Labs UI components work great together. Here’s an example combining Show, For, and Card:

Next steps

Card component

Build card layouts

Form component

Create forms with validation

Switch component

Pattern matching for rendering

TypeScript guide

Learn about TypeScript support