React Components
@clinikapi/react provides 14 pre-built clinical UI widgets that communicate through your backend proxy — never directly to ClinikAPI.
Upgrading from 0.2.x? The widgets were rebuilt on shadcn/ui in 0.3.0. Add the
styles.css import above — without it they render unstyled. No component props changed.Theming
Widgets read a set of--ck-* CSS custom properties, so you can match your brand without touching component code. Values are HSL channels, the same convention shadcn/ui uses:
theme prop — 'light' (default), 'dark', 'glassmorphism', or 'inherit'. Pass theme="inherit" in an app that already uses shadcn/ui and the widgets map straight onto your own --primary / --border / --radius variables:
--primary in a different format (a hex, say), which would render the widgets incorrectly.
The Proxy Pattern
React widgets run in the browser and cannot use the SDK directly (that would expose your API key). Instead, they talk to your backend through aproxyUrl:
Setting Up a Proxy
Using a Widget
Available Widgets
Common Props
All widgets accept:Demo Mode
SetproxyUrl="demo" to run any widget in demo mode — no backend needed, no API calls made. Useful for prototyping and showcasing.
Security
- Widgets never receive your API key
- All data flows through your backend proxy
- You control authentication and authorization on your proxy
proxyUrlis validated to prevent open redirect attacks — must be a relative path or same-origin URL