Skip to content

Commit 3657721

Browse files
committed
docs: readme update
1 parent 832fd53 commit 3657721

1 file changed

Lines changed: 57 additions & 45 deletions

File tree

README.md

Lines changed: 57 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,47 @@
11
# @zayne-labs/ui
22

3-
A collection of multi-framework UI utilities and unstyled components. Currently focused on React implementation, with plans to support other frameworks like Vue, Svelte, and Solid in the future.
3+
Composable, headless UI components and utilities built for flexibility and great developer experience. Currently supports React, with more frameworks coming soon.
44

55
## Features
66

7-
- 🚀 Framework agnostic design (React support available now, more coming soon!)
8-
- 🎨 Zero-styling approach - full control over your UI design
9-
- 🔧 Highly customizable hooks and components
10-
- 📦 Tree-shakeable modules
11-
- 🌐 Multi-framework support (coming soon)
7+
- Headless components - bring your own styles
8+
- Composable API design
9+
- Tree-shakeable ESM modules
10+
- TypeScript-first with full type safety
11+
- Built on top of [@zayne-labs/toolkit](https://github.com/zayne-labs/toolkit)
12+
13+
## Packages
14+
15+
### @zayne-labs/ui-react
16+
17+
React implementation of the UI library. More framework adapters coming in the future.
1218

1319
## Components
1420

1521
### UI Components
1622

17-
@zayne-labs/ui provides a set of headless UI components and hooks:
23+
Headless UI components for common interface patterns:
1824

19-
- **Form** - Flexible form handling with field subscriptions and validation, convenience wrapper around react-hook-form
20-
- **DropZone** - File upload zone with drag-and-drop support
2125
- **Card** - Composable card layouts
22-
- **Carousel** - Customizable slideshow for cycling through elements
23-
- **DragScroll** - Add drag-to-scroll behavior to any container
26+
- **Carousel** - Customizable slideshow component
27+
- **DragScroll** - Add drag-to-scroll behavior to containers
28+
- **DropZone** - File upload with drag-and-drop support
29+
- **Form** - Form handling with validation (wrapper around react-hook-form)
2430

25-
### Utility Components
31+
### Common Components
2632

27-
@zayne-labs/ui provides several utility components to handle common UI patterns:
33+
Utility components for declarative UI patterns:
2834

29-
- **Switch** - Conditional rendering with pattern matching
30-
- **Show** - Simplified conditional rendering
31-
- **For** - Iterative rendering with built-in empty states
35+
- **Await** - Handle async states declaratively
36+
- **ClientGate** - Client-side only rendering guard
3237
- **ErrorBoundary** - Graceful error handling
33-
- **Await** - Handle async states elegantly
34-
- **Teleport** - Teleport content to a different part of the DOM via react portals
35-
- **Slot** - Component composition with named slots
38+
- **For** - List rendering with empty states
39+
- **Presence** - Animation presence detection
40+
- **Show** - Conditional rendering
41+
- **Slot** - Component composition with slots
3642
- **SuspenseWithBoundary** - Combined Suspense and ErrorBoundary
43+
- **Switch** - Pattern matching for conditional rendering
44+
- **Teleport** - Portal-based content teleportation
3745

3846
## Installation
3947

@@ -48,7 +56,7 @@ npm install @zayne-labs/ui-react
4856
yarn add @zayne-labs/ui-react
4957
```
5058

51-
## Quick Start
59+
## Usage
5260

5361
```tsx
5462
import { Switch } from '@zayne-labs/ui-react/common/switch'
@@ -59,28 +67,40 @@ function App() {
5967
return (
6068
<Switch.Root value={status}>
6169
<Switch.Match when="loading">
62-
<div>Loading your content...</div>
70+
<div>Loading...</div>
6371
</Switch.Match>
6472

6573
<Switch.Match when="error">
66-
<div>Oops! Something went wrong</div>
74+
<div>Something went wrong</div>
6775
</Switch.Match>
6876

6977
<Switch.Default>
70-
<div>Content loaded successfully!</div>
78+
<div>Content loaded!</div>
7179
</Switch.Default>
7280
</Switch.Root>
7381
)
7482
}
7583
```
7684

85+
```tsx
86+
import { For } from '@zayne-labs/ui-react/common/for'
87+
88+
function UserList({ users }) {
89+
return (
90+
<For each={users} fallback={<p>No users found</p>}>
91+
{(user) => <div key={user.id}>{user.name}</div>}
92+
</For>
93+
)
94+
}
95+
```
96+
7797
## Documentation
7898

7999
Visit our [documentation site](https://zayne-labs-ui.netlify.app) for detailed usage instructions, examples, and API references.
80100

81101
## Development
82102

83-
This project uses pnpm as the package manager. To get started with development:
103+
This is a monorepo managed with pnpm and Turborepo.
84104

85105
```bash
86106
# Install dependencies
@@ -89,38 +109,30 @@ pnpm install
89109
# Build all packages
90110
pnpm build
91111

92-
# Run development build
93-
pnpm build:dev
112+
# Run development mode
113+
pnpm dev:react
114+
115+
# Run docs site
116+
pnpm dev:docs
94117

95-
# Run tests
96-
pnpm build:test
118+
# Run dev playground
119+
pnpm dev:dev
97120

98-
# Lint code
121+
# Lint
99122
pnpm lint:eslint
100123

124+
# Type check
125+
pnpm lint:type-check
126+
101127
# Format code
102128
pnpm lint:format
103129
```
104130

105-
## Project Structure
106-
107-
```tree
108-
ui/
109-
├── packages/
110-
│ └── ui-react/ # React UI components (More frameworks coming soon!)
111-
├── apps/
112-
│ ├── docs/ # Documentation site
113-
│ └── dev/ # Development playground
114-
├── .changeset/ # Changesets for versioning
115-
└── package.json # Root package.json
116-
```
117131

118132
## Contributing
119133

120-
We welcome contributions! Please see our [contributing guidelines](https://github.com/zayne-labs/contribute.git) for details.
134+
Contributions are welcome! Check out the [contributing guidelines](https://github.com/zayne-labs/contribute.git) to get started.
121135

122136
## License
123137

124-
MIT © [Zayne Labs]
125-
126-
---
138+
MIT © Ryan Zayne

0 commit comments

Comments
 (0)