Skip to main content

React Components

@clinikapi/react provides 14 pre-built clinical UI widgets that communicate through your backend proxy — never directly to ClinikAPI.
Then import the stylesheet once, anywhere in your app:
That is the entire setup. The widgets are built on shadcn/ui + Radix, and every rule in the stylesheet is scoped to the widgets’ own root element — it cannot restyle your pages, and you do not need Tailwind (or any particular build setup) to use it.
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:
Every widget also takes a 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:
This is opt-in rather than automatic, because an app that is not using shadcn/ui may define --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 a proxyUrl:

Setting Up a Proxy

Using a Widget

Available Widgets

Common Props

All widgets accept:

Demo Mode

Set proxyUrl="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
  • proxyUrl is validated to prevent open redirect attacks — must be a relative path or same-origin URL