Install
Install the package for your framework. Each pulls in only its own adapter plus the shared core.
| Using | Install | Binding |
|---|---|---|
| No framework: plain HTML, HTMX, Alpine, Astro, Rails, Laravel, Django, PHP, WordPress | oklch-picker | <oklch-picker> element |
| React / Preact | @oklch-picker/react | value + onChange |
| Vue | @oklch-picker/vue | v-model |
| Svelte 5 | @oklch-picker/svelte | bind:value |
| Solid | @oklch-picker/solid | value + onChange |
npm install @oklch-picker/reactnpm install @oklch-picker/vuenpm install @oklch-picker/sveltenpm install @oklch-picker/solidnpm install @oklch-picker/angularnpm install @oklch-picker/qwiknpm install oklch-pickernpm install oklch-pickerThe stylesheet
It lives in the shared core, which every adapter already depends on:
import "@oklch-picker/core/styles.css";Your framework is an optional peer dependency. Preact works throughpreact/compat, which most Preact setups already alias.
The shared core
@oklch-picker/core holds the colour maths and the headless model, with no UI. Every adapter depends on it, and it is worth installing on its own if you want the maths without a picker: validating stored colours on a server, generating palettes, or naming colours in a table. See colour utilities.
import { colourName, clampToGamut, maxChroma } from "@oklch-picker/core";Whichever you import, the props are the same (presets,layout, parts, labels,classPrefix), and the value semantics follow each framework's idiom.
Coming from oklch-picker 0.2 or earlier?
oklch-picker used to be the React component; it is now the no-framework custom element, so that npm i oklch-picker gives the build that works anywhere. Framework users move to a scoped package:
| Was | Now |
|---|---|
oklch-picker | @oklch-picker/react |
oklch-picker/vue | @oklch-picker/vue |
oklch-picker/svelte | @oklch-picker/svelte |
oklch-picker/solid | @oklch-picker/solid |
oklch-picker/vanilla | oklch-picker |
oklch-picker/colour | @oklch-picker/core |
oklch-picker/styles.css | @oklch-picker/core/styles.css |
Nothing else changes. The components, props, and emitted values are identical. The split exists so an app downloads only the adapter it uses instead of every one of them.