# Filter Menu

Filter Menu is a Premium standalone component from AI Canvas (https://aicanvas.me): it belongs to no design system and works in any React + Tailwind app. Index of every component and install setup: https://aicanvas.me/llms.txt

A skeuomorphic pill that expands into a multi-select filter checklist with Apply.

- Category: Inputs & Controls
- Built with: Motion, Tailwind CSS
- License: Premium (proprietary, not in the public repo)
- Page: https://aicanvas.me/components/filter-menu

## Install

```bash
npx shadcn@latest add @aicanvas/filter-menu
```

Requires Premium. Set your AI Canvas token as AICANVAS_TOKEN and register the @aicanvas registry with it, as described in the Install section of https://aicanvas.me/llms.txt. Without a Premium token the command writes a placeholder (a `PremiumLocked` notice) instead of the component.

AI agents can also get its install command from the read-only AI Canvas MCP server (`npx -y @aicanvas/mcp`) and run it. Setup: https://aicanvas.me/mcp

Peer dependencies:

```bash
npm install framer-motion
```

## Use it

It installs to `components/aicanvas/filter-menu.tsx` (under `src/` if your project has one). With the usual `@/` alias:

```tsx
import FilterMenu from '@/components/aicanvas/filter-menu'

<FilterMenu />
```

## Props

### FilterOption

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | `string` |  | Unique id used to track selection. |
| `label` | `string` |  | Text shown for the filter row. |
| `icon?` | `React.ComponentType<{ size?: number }>` |  | Optional icon component rendered before the label. |

### FilterMenu

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `filters?` | `FilterOption[]` | `DEFAULT_FILTERS` | The filter rows shown inside the open panel. |
| `defaultSelected?` | `string[]` | `[]` | Ids selected and applied on mount (uncontrolled). |
| `onApply?` | `(ids: string[]) => void` |  | Called with the applied filter ids when Apply is pressed. |
| `label?` | `string` | `'Filters'` | Text for the closed trigger button. |
| `className?` | `string` |  | Extra classes merged onto the outermost root element. |

## About

Filter Menu is a skeuomorphic pill that expands into a rounded multi-select panel: six labelled rows, each with an icon and a circular checkmark that fills when selected, above an Apply button carrying a live count. Pressing Apply collapses everything back into the pill and slides a badge out from behind it showing how many filters are live, with a small clear button attached. Motion drives the layout morph, the row springs, and the staggered reveal, while a click anywhere outside quietly dismisses the panel. Rows, defaults, and the apply callback are all props, and the control ships with listbox roles, visible focus rings, and a matching dark theme. It suits catalogue pages, search result headers, and job listings that need more than a plain dropdown.

Use cases: Search results, Product catalog, Job listings.

## Source

The source is Premium and is not published. Preview it at https://aicanvas.me/components/filter-menu.

## Remix prompt

Only when the user wants Filter Menu rebuilt from scratch instead of installed: the public part of its remix prompt is in the Remix panel at https://aicanvas.me/components/filter-menu.

## Related

- [Glass AI Composer](https://aicanvas.me/components/glass-ai-compose.md): Glassmorphism AI chat input with image upload, web search toggle, and model switcher.
- [Glass Search Bar](https://aicanvas.me/components/glass-search-bar.md): Glassmorphism search bar with animated suggestion dropdown, active state glow, and reduced-motion support.
- [Glass Stepper](https://aicanvas.me/components/glass-stepper.md): Glassmorphism numeric stepper with spring number flip, notification-style tinted buttons, and configurable min/max/step.
- [Radial Toolbar](https://aicanvas.me/components/radial-toolbar.md): A radial context menu that fans out formatting tools around a centre button, with active toggle states and an animated label pill.
- [Glass Slider](https://aicanvas.me/components/glass-slider.md): Range sliders with glass tracks, glowing colored fills, and spring-animated thumbs that scale on drag.
