Frontend Development
This section covers building Stately frontends with TypeScript and React, including runtime setup, hooks, components, and plugin integration.
Core Packages
Quick Reference
Runtime Setup
Using Hooks
Using Components
Package Structure
@statelyjs/schema
- Schema type definitions
- Node parsing and validation
- Plugin system types
- No React dependencies
@statelyjs/ui
Base UIcomponents (Button, Card, Dialog, etc.)- Layout system (Root, Page, Navigation, etc.)
- Component and transformer registries
- Theme provider
- Plugin infrastructure
@statelyjs/stately
- "Core" plugin with entity management
- React hooks for CRUD operations against entities
- Pre-built views and pages
- Utilities and helpers
- Codegen CLI
- Stately Schema and UI Runtimes (with "Core" baked in)
Code Generation
Generate TypeScript types from your backend's OpenAPI spec:
This creates:
types.ts- TypeScript types from OpenAPI componentsschemas.ts- Parsed schema definitions for runtime form generation