Svelte 5 component library
CropWatch UI
The shared interface kit behind CropWatch: 52 accessible components, charts and helpers built on plain CSS custom properties, with matching dark and light themes. Browse the components below or from the sidebar. Every page has live examples, the full API and copy-paste snippets.
For designers
Design style guide
Colour tokens for dark and light mode with measured contrast ratios, the logo and brand colours, typography, spacing, chart colours, form anatomy and a hand-off checklist. Start here before designing a CropWatch screen.
Components
Form Controls
Data Display
Feedback & Overlays
Charts
Full Page Demos
Getting started
- Point the scope at GitHub Packages. Add this to your project's
.npmrc, with a token that hasread:packages.@cropwatchdevelopment:registry=https://npm.pkg.github.com //npm.pkg.github.com/:_authToken=${GITHUB_TOKEN} - Install the package.
pnpm add @cropwatchdevelopment/cwui - Load the styles once in your root layout. This single import brings in the design tokens and both themes.
<script lang="ts"> import '@cropwatchdevelopment/cwui/styles'; let { children } = $props(); </script> {@render children()} - Choose a theme. Themes switch with the
data-themeattribute on<html>, or use CwThemePicker to let people choose.<!-- app.html: dark is the default; set "light" to switch --> <html lang="en" data-theme="dark">
Upgrading an existing install
Clear local build artifacts first so SvelteKit picks up the new components.
rm -rf node_modules .svelte-kit
pnpm install
pnpm up @cropwatchdevelopment/cwui --latest