# Expandable Search Bar

> This expandable search bar is a sleek, animated UI element designed for modern web applications. It collapses into a compact icon for space efficiency and smoothly expands to reveal a fully functional search input with placeholder animation, auto-focus, and submission handling. Perfect for navigation headers, dashboards, or any interface needing intuitive search functionality. Built with React and Framer Motion for fluid animations, it's customizable for left/right expansion and integrates seamlessly with Tailwind CSS for styling. Enhance user engagement with keyboard support (Enter to search, Escape to close) and responsive behavior.

- Author: [Arunachalam](https://21st.dev/@arunachalam)
- License: unknown
- npm dependencies: lucide-react, framer-motion
- Live preview: https://21st.dev/@arunachalam/components/expandable-search-bar

## Install

```bash
npx shadcn@latest add "https://21st.dev/r/arunachalam/expandable-search-bar?api_key=$API_KEY_21ST"
```

Requires a 21st API key (generate one at https://21st.dev/mcp) passed as `API_KEY_21ST`. Free accounts get a limited number of installs per day; unlimited on a paid plan — see https://21st.dev/pricing.

Full component directory: https://21st.dev/llms.txt
