Staaarter

Search Bar Hero

A horizontal search bar with a location input, a Dates button that toggles a small panel with real check-in/check-out date pickers, a Guests button that toggles a panel with real +/- counters for adults, children, and rooms, and a Search button. Stacks vertically on mobile, lays out in a row from the sm breakpoint up.

By Staaarter Team
Booking
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/search-bar-hero.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/booking/booking12.tsx instead.

Usage

The file also exports booking12Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Booking12, booking12Demo } from "@/components/blocks/booking/booking12";

export default function Page() {
  return <Booking12 {...booking12Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Find your next stay"Heading above the search bar.
locationPlaceholderstring"Search destinations"Placeholder text for the location input.
classNamestringnoneExtra classes for the outer section element.

Behavior notes

  • The Dates button is real client state: clicking it opens/closes a panel with two real native date inputs (check-in, check-out), and the button label updates to show the chosen range.
  • The Guests button is real client state: clicking it opens/closes a panel with real +/- counters for Adults, Children, and Rooms, each with its own useState and a sensible minimum, and the button label reflects the current counts.
  • The Search button is decorative only, no search is actually performed.