@flexprice/ui) skips that work. It’s the actual React components from the Flexprice dashboard, published as an installable library, so your pricing page, usage dashboard, and billing screens match a production system on day one instead of a first draft.
Every component is presentational: no fetching, no auth, no routing baked in. You own the data. Feed a component from the Flexprice SDK, the REST API, your own backend, or a plain JSON file, and it renders identically either way.
Themeable
One CSS variable away from your brand.
Dark mode built in
Every component ships a light and dark treatment.
Full TypeScript
Typed props and adapters, no
any.SSR-ready
Works in Next.js, Remix, and Astro.
Components in the UI kit
- Pricing
- Usage
- Credits
Feed this to an LLM
The full Flexprice documentation, including every component on this page, as one plain-text file at
/llms-full.txt. Open it to copy the raw text, or paste the link into an AI tool that can fetch URLs.Installing the UI kit
UI kit peer dependencies
react and react-dom (v18).
Importing the UI kit stylesheet
Import the stylesheet once in your app:Ways to provide data to the components
Every component follows the same pattern: fetch data from a source you choose, map it into the presentational props the component expects, and render.Option 1: Fetch with the Flexprice SDK (recommended)
Option 2: Fetch from the Flexprice REST API
Option 3: Fetch through your own backend
Option 4: Fetch from your own APIs
Option 5: Pass static JSON
Best for documentation sites, marketing pages, and demos.Which data source to choose
Component pages document the exact prop shapes and any adapters for mapping Flexprice API responses.
Theming the UI kit
Every component renders inside an element carrying theflexprice-ui class, and that element is
where the theme tokens are declared. Override them with a selector that matches that element —
--primary is the accent hook:
243 75% 59%, not hsl(243 75% 59%) or #4f46e5.
Add the dark class to any ancestor to toggle dark mode:
Event callbacks on the components
Components expose callbacks for user actions (selection, checkout, contact sales, and similar). Wire them to analytics, Checkout, a payment provider, or your own flow. See each component page for the callbacks it supports.Server-side rendering the UI kit
Components work with SSR in Next.js (App Router and Pages Router), Remix, and Astro. Fetch data on the server when you can, then pass it as props to avoid client-only waterfalls.A typical UI kit integration flow
1
Install the package
Add
@flexprice/ui and ensure react / react-dom are available as peer dependencies.2
Import stylesheet and components
Import
@flexprice/ui/style.css once, then import the components you need.3
Choose a data source
Pick Flexprice SDK, REST APIs, your backend, your own APIs, or static JSON — see Ways to provide data.
4
Fetch and map data
Load records from your source and map them into each component’s presentational props (adapters are documented on the component pages).
5
Pass props and render
Pass the mapped data (and any callbacks) into the component and render it in your page or layout.
Components planned for the UI kit
The package is designed to expand beyond the current exports. Planned surfaces include invoices, subscription details, and the full customer portal. New components follow the same pattern: install from@flexprice/ui, load data from any source, map into props, and render.
