---
title: "Chip Search Bar"
description: "Free React search bar that widens on focus and unfolds recent searches. Terms become removable chips and suggestions filter as you type. shadcn install."
category: "Blocks"
parent: "https://beui.dev/components/blocks/morphing-search"
publishedAt: "2026-08-18"
updatedAt: "2026-11-24"
documentation: "https://beui.dev/components/blocks/morphing-search/chips"
markdown: "https://beui.dev/components/blocks/morphing-search/chips.md"
license: "MIT"
---

# Chip Search Bar

> Free React search bar that widens on focus and unfolds recent searches. Terms become removable chips and suggestions filter as you type. shadcn install.

## Install

```bash
npx shadcn@latest add @beui/morphing-search-chips
```

## Dependencies

- `clsx`
- `lucide-react`
- `motion`
- `react`
- `tailwind-merge`

## Usage

### Chip Search usage

Docked search bar that springs wider on focus and unfolds a recent-searches panel out of its own edge. Terms become removable chips, the bar grows with them, and suggestions filter as you type.

```tsx
"use client";

import { MorphingSearchChips } from "@/components/motion/morphing-search-chips";

const tiles = [
  "from-rose-400/40 to-orange-300/30",
  "from-sky-400/40 to-blue-400/30",
  "from-emerald-400/40 to-teal-300/30",
  "from-amber-300/40 to-rose-300/30",
  "from-pink-400/40 to-rose-300/30",
  "from-teal-300/40 to-sky-300/30",
];

export function MorphingSearchChipsPreview() {
  return (
    <div className="relative flex h-[440px] w-full max-w-2xl flex-col justify-end overflow-hidden rounded-3xl border border-border bg-muted/40 p-4">
      <div aria-hidden="true" className="absolute inset-4 grid grid-cols-3 gap-3 opacity-80">
        {tiles.map((tile) => (
          <div key={tile} className={`rounded-2xl bg-gradient-to-br ${tile}`} />
        ))}
      </div>
      <MorphingSearchChips
        className="mx-auto"
        placeholder="Search inspiration"
        label="Search inspiration"
        defaultChips={["onboarding"]}
        defaultRecents={["dashboards", "empty states", "pricing pages"]}
        storageKey="beui:morphing-search-chips:recents"
        maxChips={4}
        suggestions={[
          "dashboards",
          "data tables",
          "dark mode",
          "empty states",
          "onboarding",
          "pricing pages",
          "settings",
          "sign in",
        ]}
      />
    </div>
  );
}
```

## API Reference

### MorphingSearchChips

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `chips` | `string[]` | — | No | Active filters shown as chips inside the bar. |
| `defaultChips` | `string[]` | `[]` | No | The initial chips when uncontrolled. Default: [] |
| `onChipsChange` | `((chips: string[]) => void)` | — | No | Called with the full list when a chip is added or removed. |
| `query` | `string` | — | No | Text in the field. |
| `defaultQuery` | `string` | — | No | The initial field text when uncontrolled. Default: "" |
| `onQueryChange` | `((query: string) => void)` | — | No | Called with the new text when the field changes. |
| `recents` | `string[]` | — | No | Recent searches, newest first. |
| `defaultRecents` | `string[]` | `[]` | No | The initial recent searches when uncontrolled. Default: [] |
| `onRecentsChange` | `((recents: string[]) => void)` | — | No | Called with the full list when a recent search is added or removed. |
| `storageKey` | `string` | — | No | Persist uncontrolled recents in localStorage under this key. |
| `maxRecents` | `number` | `5` | No | How many recent searches to keep. Default 5. |
| `suggestions` | `string[]` | `[]` | No | Terms offered while typing. |
| `filter` | `false \| ((term: string, query: string) => boolean)` | — | No | How suggestions match the query. Default: case-insensitive substring. Pass `false` when `suggestions` already arrive filtered, e.g. from a server. |
| `maxSuggestions` | `number` | `6` | No | How many matches to list under the typed query. Default 6. |
| `loading` | `boolean` | `false` | No | Suggestions are being fetched. |
| `maxChips` | `number` | — | No | Most chips allowed at once. |
| `normalize` | `((term: string) => string \| null)` | — | No | Clean a term before it becomes a chip; return null to reject it. |
| `emptyState` | `ReactNode` | — | No | Shown when the field is empty and there are no recent searches. |
| `side` | `"top" \| "bottom" \| "auto"` | `top` | No | Which way the surface grows. "auto" grows up unless there is no room. Default "top". |
| `open` | `boolean` | — | No | Whether the suggestions panel is open, for controlled use. |
| `defaultOpen` | `boolean` | `false` | No | Whether the panel starts open when uncontrolled. Default: false |
| `onOpenChange` | `((open: boolean) => void)` | — | No | Called with the new open state when the panel opens or closes. |
| `disabled` | `boolean` | `false` | No | Dims the bar and blocks typing, chip removal and the panel. Default: false |
| `name` | `string` | — | No | Submit each chip with a form under this name. |
| `placeholder` | `string` | — | No | Hint text in the empty field. Default: "Search" |
| `label` | `string` | — | No | Accessible name for the search field. |
| `actions` | `ReactNode` | — | No | Trailing controls inside the bar, such as filter buttons. |
| `className` | `string` | — | No | Classes merged onto the root element. |
| `labels` | `Partial<{ placeholder: string; label: string; suggestions: string; recent: string; recentSearches: string; clear: string; searching: string; removeFilter: string; hint: string; filterLimit: string; ... 4 more ...; filterMarked: string; }>` | — | No | Override any built-in string. |

## More in Morphing Search

- [Morphing Search](https://beui.dev/components/blocks/morphing-search/overlay.md)

## Source

- Registry detail: https://beui.dev/r/morphing-search-chips
- Raw source: https://beui.dev/r/morphing-search-chips/raw
- GitHub: https://github.com/starc007/ui-components
