Installation
Zayne Labs Toolkit is available as a monorepo with three packages. You can install individual packages based on your needs or install all of them together.Prerequisites
Node.js 18.x or higher is required. Verify your Node version:
Package Overview
The toolkit consists of three main packages:| Package | Description | Size Limit |
|---|---|---|
@zayne-labs/toolkit-core | Core utilities and helpers | ~6.5 KB |
@zayne-labs/toolkit-react | React hooks and utilities | ~6.5 KB (hooks) |
@zayne-labs/toolkit-type-helpers | TypeScript type utilities | ~600 B |
Installation Methods
Install Core Utilities
For framework-agnostic utilities that work anywhere:Install React Package
For React-specific hooks and utilities:The React package has peer dependencies:
react>= 19.0.0@types/react>= 19.0.0 (optional)zustand5.x.x (optional, only if using Zustand utilities)tailwind-merge^2.5.0 || ^3.0.0 (optional)
Install Type Helpers
For TypeScript type utilities and helpers:Install Multiple Packages
Install all packages you need in a single command:TypeScript Configuration
For the best experience with TypeScript, ensure yourtsconfig.json includes:
tsconfig.json
Optional: Type Reset
The type helpers package includes optional TypeScript resets for improved type safety:tsconfig.json
Verify Installation
Create a simple test file to verify the installation:test.ts
Package Exports
Each package provides specific export paths for tree-shaking:Core Package
React Package
Type Helpers Package
Next Steps
Quick Start
Build your first app with the toolkit.
Core Utilities
Explore available core utilities.
React Hooks
Discover React hooks and utilities.
Type Helpers
Learn about TypeScript utilities.
Troubleshooting
Module not found errors
Module not found errors
Ensure you’re using a bundler that supports ESM (Vite, Webpack 5+, or Rollup) and that your
package.json has "type": "module" if using Node.js directly.TypeScript errors with React hooks
TypeScript errors with React hooks
Make sure you have
@types/react >= 19.0.0 installed and that your TypeScript version is 5.0 or higher.Peer dependency warnings
Peer dependency warnings
The React package has optional peer dependencies. You only need to install
zustand if you’re using Zustand utilities, and tailwind-merge if you’re using style utilities.