@flexprice/ui is the Flexprice UI kit: the React components the Flexprice dashboard itself renders, published from flexprice-front as one package with pricing, usage, and credits widgets. Every component is presentational. It takes props and renders; you decide where the data comes from. This page covers installation per framework. Fetch entitlements and usage on the client covers the data.
What the UI kit package ships
Installing in React (Vite, CRA, or any SPA)
Installing in Next.js
The components render on the server and hydrate on the client. Import the stylesheet in the root layout (App Router) or_app.tsx (Pages Router).
- App Router
- Pages Router
onSelectPlan, onBillingPeriodChange) need a client boundary:Installing in Remix and Astro
Both work with the same two steps: import the stylesheet once (inroot.tsx for Remix, in the layout for Astro) and pass data from a loader or frontmatter into the component. In Astro, add client:load to components with callbacks so they hydrate:
Installing in plain HTML (no bundler)
The CommonJS file is also a UMD bundle, so a page with no build step can load React, ReactDOM, and the kit from<script> tags and reach the components on the FlexpriceUI global:
Using the kit with Vue, Svelte, and other frameworks
There is no Vue or web-component build of the kit. Two options work now:- Mount a React island. Render the component into a container with
react-dom. The island is self-contained, so it works inside a Vue or Svelte page. - Use the data, not the components. Fetch entitlements and usage as described in Fetch entitlements and usage on the client and render them with your own markup.
Theming the installed components
Components read CSS variables declared on the.flexprice-ui element. Override --primary with HSL channels, and add the dark class to any ancestor for dark mode:
Map API data with the exported adapters
The kit exports adapter functions that turn raw Flexprice API responses into each component’s prop shape, andnormalize* functions that validate untrusted data at runtime before rendering:
Each component page documents the adapter and the API endpoint it expects. Start from the UI kit overview.
Next steps with the UI kit
Fetch data on the client
Portal sessions and backend proxies.
Harden client access
Keep keys server-side and cache safely.
Components
Every component with a live preview.

