Filter Popover
A compact multi-select filter: a button with a count badge that opens a checkbox popover with reset.
npx shadcn@latest add https://ui.develop-better-solutions.com/r/filter-popover.jsonDependencies:
lucide-reactUsage
filter-popover-example.tsx
"use client";
import { useState } from "react";
import { FilterPopover } from "@dbs/ui";
export default function FilterPopoverExample() {
const [value, setValue] = useState<string[]>(["loading"]);
return (
<div className="flex min-h-[380px] w-full max-w-sm justify-end rounded-2xl border border-line p-6">
<FilterPopover
value={value}
onChange={setValue}
options={[
{ value: "loading", label: "Loading", count: 5 },
{ value: "ready", label: "Ready", count: 3 },
{ value: "completed", label: "Completed", count: 2 },
{ value: "not-started", label: "Not started", count: 2 },
]}
/>
</div>
);
}