Toggle sidebar

Installation

Flux is a robust, hand-crafted, UI component library for your React applications. It's built using Tailwind CSS and uses your app's theme.

Prerequisites

Flux requires the following before installing:

Getting started

1

Install Flux

Flux can be installed via npm from your project root:
Copy to clipboard
npm install @fluxui-dev/react
2

Set up Tailwind

Add the following to your app's main CSS file, such as resources/css/app.css:
Copy to clipboard
@import 'tailwindcss';@import '@fluxui-dev/react/flux.css';@custom-variant dark (&:where(.dark, .dark *));
If you don't have Tailwind installed, you can learn how to install it on the Tailwind website.
3

Add FluxProvider

Import FluxProvider from @fluxui-dev/react/inertia. Wrap your Inertia app with it in createInertiaApp:
Copy to clipboard
// resources/js/app.tsximport { FluxProvider } from '@fluxui-dev/react/inertia';import { createInertiaApp } from '@inertiajs/react';createInertiaApp({    withApp: (app) => <FluxProvider>{app}</FluxProvider>,});
This provider connects Flux to Inertia for links, forms, validation errors, and the current page. See the Inertia guide for the details.
Render FluxProvider from @fluxui-dev/react in a client component. Pass it your framework's link component, such as Next's Link:
Copy to clipboard
// app/providers.tsx'use client';import { FluxProvider } from '@fluxui-dev/react';import Link from 'next/link';import { usePathname } from 'next/navigation';export function Providers({ children }: { children: React.ReactNode }) {    return (        <FluxProvider link={Link} currentUrl={usePathname}>            {children}        </FluxProvider>    );}
Then use it in your root layout:
Copy to clipboard
// app/layout.tsx<body>    <Providers>{children}</Providers></body>
Server components can render Flux components directly. Inside a server component, use the flat part names like DropdownTrigger instead of Dropdown.Trigger.
Import FluxProvider from @fluxui-dev/react. Wrap your app with it where you render it, such as main.tsx:
Copy to clipboard
// src/main.tsximport { FluxProvider } from '@fluxui-dev/react';import { createRoot } from 'react-dom/client';import App from './App';createRoot(document.getElementById('root')!).render(    <FluxProvider>        <App />    </FluxProvider>,);
If you use a router, pass its link component to FluxProvider. React Router's link component takes to instead of href, so wrap it in a small component first:
Copy to clipboard
import type { ComponentProps } from 'react';import { Link } from 'react-router';type RouterLinkProps = ComponentProps<'a'> & { href: string };function RouterLink({ href, ...props }: RouterLinkProps) {    return <Link to={href} {...props} />;}<FluxProvider link={RouterLink}>{children}</FluxProvider>
Flux links now navigate through your router. External links, downloads, and links that open in a new tab stay plain links.
To get your link component's props typed on Flux components, register it once with a module declaration:
Copy to clipboard
import type Link from 'next/link';declare module '@fluxui-dev/react' {    interface Register {        link: typeof Link;    }}
FluxProvider can also connect Flux to your router and form library:
  • currentUrl marks the current page in navigation.
  • errors shows validation errors on fields.
  • processing shows a loading state on submit buttons.
4

Set up dark mode

Add this to your head to set up dark mode and avoid flicker:
Copy to clipboard
<script>    (() => {        let saved;        try { saved = localStorage['flux.appearance']; } catch {}        const media = matchMedia('(prefers-color-scheme: dark)');        const dark = saved ? saved === 'dark' : media.matches;        const html = document.documentElement;        html.classList.toggle('dark', dark);        html.style.colorScheme = dark ? 'dark' : 'light';    })();</script>
React renders the whole page, so FluxProvider adds the script for you. Add suppressHydrationWarning to the html element in your root layout, because the script changes its class before React hydrates:
Copy to clipboard
// app/layout.tsx<html lang="en" suppressHydrationWarning>
Add this to your head to set up dark mode and avoid flicker:
Copy to clipboard
<script>    (() => {        let saved;        try { saved = localStorage['flux.appearance']; } catch {}        const media = matchMedia('(prefers-color-scheme: dark)');        const dark = saved ? saved === 'dark' : media.matches;        const html = document.documentElement;        html.classList.toggle('dark', dark);        html.style.colorScheme = dark ? 'dark' : 'light';    })();</script>
5

Use the Inter font family

Although completely optional, we recommend using the Inter font family.
Copy to clipboard
@theme {    --font-sans: Inter, ui-sans-serif, system-ui, sans-serif;    ...}
6

Use a component

Import components from @fluxui-dev/react and use them anywhere in your app:
Copy to clipboard
import { Button } from '@fluxui-dev/react';<Button variant="primary">Get started</Button>
Copyright © 2026 Wireable LLC ·Terms of Service
Built with by
Caleb Porzio and Hugo Sainte-Marie