Install
Add a filter to your React app in a minute
Works in Next.js, Vite or any React 19 app with Tailwind CSS 4.2 or later and TypeScript.
Set up the shadcn CLI
FiltersUI uses it only to copy files into your project. Once per project, and skip it if you have a
components.jsonfile.npx shadcn@latest initPress Enter to take the defaults.
Add a filter
npx shadcn@latest add https://filtersui.com/r/range-histogram.jsonThe files go into
components/filters-uiand are yours to change. Each filter’s page has its own command under Install.Use it
components/price-filter.tsx"use client"; import { useState } from "react"; import { RangeHistogram } from "@/components/filters-ui/filters/range-histogram"; import { FilterCard } from "@/components/filters-ui/ui/filter-card"; import type { RangeValue } from "@/components/filters-ui/ui/range-chart"; export function PriceFilter() { const [price, setPrice] = useState<RangeValue>([null, null]); return ( <FilterCard title="Price" onClear={() => setPrice([null, null])} defaultOpen> <RangeHistogram min={0} max={100000} step={1000} value={price} onChange={setPrice} /> </FilterCard> ); }Each filter’s page has a full example under Code.
Light and dark
Filters are dark out of the box. To follow your app’s light and dark mode, add this to your global CSS. It uses the .dark class, as shadcn does.
:root {
--fu-accent: #3B57E6;
--fu-accent-hover: #2F4AD0;
--fu-accent-pale: #253A9E;
--fu-accent-soft: #3049D2;
--fu-bar: rgb(255 255 255/0.94);
--fu-bar-out: #D6D6D2;
--fu-card: #FFFFFF;
--fu-card-border: #E5E5E2;
--fu-card-hover: #F8F8F6;
--fu-control-border: #787874;
--fu-control-hover: #5B5B57;
--fu-dim: #555552;
--fu-field-border: #949490;
--fu-field-wash: #FFFFFF;
--fu-glow-amber: #F29358;
--fu-glow-blue: #4C6BFF;
--fu-glow-rose: #E8708A;
--fu-glow-teal: #1FC2AD;
--fu-glow-violet: #8A6CFF;
--fu-handle: #FFFFFF;
--fu-handle-edge: rgb(29 27 24/0.55);
--fu-hover: rgb(29 27 24/0.11);
--fu-hover-wash: rgb(29 27 24/0.07);
--fu-input: #FFFFFF;
--fu-item-hover: #F2F2F0;
--fu-line: #C4C4C0;
--fu-link-line: rgb(52 80 216/0.4);
--fu-menu-edge: #C4C4C0;
--fu-mute: #444442;
--fu-on-accent: #FFFFFF;
--fu-on-accent-mute: #E1E7FF;
--fu-panel: #EDEDEA;
--fu-pill: rgb(29 27 24/0.06);
--fu-pill-hover: rgb(29 27 24/0.1);
--fu-pill-square: rgb(29 27 24/0.07);
--fu-pill-text: #3C3C3A;
--fu-rail: #D6D6D2;
--fu-rim: rgb(255 255 255/0.7);
--fu-row-active: rgb(29 27 24/0.05);
--fu-row-hover: rgb(29 27 24/0.06);
--fu-row-press: rgb(29 27 24/0.09);
--fu-scrim: rgb(29 27 24/0.32);
--fu-search: #FFFFFF;
--fu-segment-track: rgb(29 27 24/0.07);
--fu-selected: #E8EDFD;
--fu-shadow: rgb(36 36 33/0.12);
--fu-shadow-deep: rgb(36 36 33/0.16);
--fu-share: rgb(29 27 24/0.04);
--fu-share-hover: rgb(29 27 24/0.07);
--fu-skeleton: rgb(29 27 24/0.09);
--fu-skeleton-on: rgb(48 73 210/0.18);
--fu-surface-1: #FFFFFF;
--fu-surface-3: rgb(29 27 24/0.07);
--fu-swatch-edge: rgb(29 27 24/0.2);
--fu-swatch-text: #363634;
--fu-text: #1B1B19;
--fu-thumb: #FFFFFF;
--fu-token: #E8EDFD;
--fu-token-edge: #3049D2;
--fu-token-text: #3049D2;
--fu-track: rgb(29 27 24/0.07);
--fu-wash: rgb(29 27 24/0.05);
--fu-well: rgb(29 27 24/0.05);
}
.dark {
--fu-accent: #3B57E6;
--fu-accent-hover: #3450D4;
--fu-accent-pale: #D1DDFF;
--fu-accent-soft: #8FAAFF;
--fu-bar: rgb(31 31 31/0.94);
--fu-bar-out: #4A4A4A;
--fu-card: #1F1F1F;
--fu-card-border: #2A2A2A;
--fu-card-hover: #262626;
--fu-control-border: #737373;
--fu-control-hover: #A3A3A3;
--fu-dim: #929292;
--fu-field-border: #737373;
--fu-field-wash: rgb(255 255 255/0.03);
--fu-glow-amber: #F59E6C;
--fu-glow-blue: #4C6BFF;
--fu-glow-rose: #EC8092;
--fu-glow-teal: #2DD4BF;
--fu-glow-violet: #8A6CFF;
--fu-handle: #F8F5F1;
--fu-handle-edge: rgb(0 0 0/0.25);
--fu-hover: #333333;
--fu-hover-wash: rgb(255 255 255/0.14);
--fu-input: rgb(0 0 0/0);
--fu-item-hover: #2A2A2A;
--fu-line: #404040;
--fu-link-line: rgb(143 170 255/0.4);
--fu-menu-edge: #737373;
--fu-mute: #BDBDBD;
--fu-on-accent: #FFFFFF;
--fu-on-accent-mute: #E1E7FF;
--fu-panel: #141414;
--fu-pill: rgb(255 255 255/0.1);
--fu-pill-hover: rgb(255 255 255/0.16);
--fu-pill-square: #333333;
--fu-pill-text: #C8C8C8;
--fu-rail: #4A4A4A;
--fu-rim: rgb(255 255 255/0.04);
--fu-row-active: rgb(255 255 255/0.07);
--fu-row-hover: rgb(255 255 255/0.1);
--fu-row-press: rgb(255 255 255/0.12);
--fu-scrim: rgb(0 0 0/0.6);
--fu-search: #2A2A2A;
--fu-segment-track: #2A2A2A;
--fu-selected: #1F2747;
--fu-shadow: rgb(0 0 0/0.5);
--fu-shadow-deep: rgb(0 0 0/0.8);
--fu-share: rgb(255 255 255/0.05);
--fu-share-hover: rgb(255 255 255/0.1);
--fu-skeleton: rgb(255 255 255/0.12);
--fu-skeleton-on: rgb(143 170 255/0.3);
--fu-surface-1: #171717;
--fu-surface-3: #2A2A2A;
--fu-swatch-edge: rgb(255 255 255/0.2);
--fu-swatch-text: #EDEAE6;
--fu-text: #F8F5F1;
--fu-thumb: #404040;
--fu-token: #D1DDFF;
--fu-token-edge: #D1DDFF;
--fu-token-text: #171717;
--fu-track: rgb(255 255 255/0.06);
--fu-wash: rgb(255 255 255/0.08);
--fu-well: rgb(0 0 0/0.22);
}Add by name
FiltersUI is listed in the shadcn directory, so you can add any filter by its name:
npx shadcn@latest add @filtersui/range-histogramYour AI assistant can now find and add filters too, through shadcn’s MCP server:
npx shadcn@latest mcp init --client claudeFor Cursor, VS Code or Codex, use cursor, vscode or codex in place of claude.
With an AI prompt
Open a filter and copy its prompt for Claude Code, Cursor, v0 or Lovable. It tells your AI what to install and how to connect your data.
Without shadcn
Copy the files from a filter’s Code tab, then install the two packages they use:
npm install clsx tailwind-mergeUpdate a filter
Run its add command again with overwrite on. This replaces the files, your edits included.
npx shadcn@latest add https://filtersui.com/r/range-histogram.json --overwriteIf something looks off
- Buttons or fields look wrong: a global style such as
button { padding: 8px }outside a layer beats Tailwind. Move it into@layer base. - Spacing missing at the start or end of a row: update to Tailwind CSS 4.2 or later.