saurabh-travel-components
v0.1.0
Published
Reusable travel UI components for Next.js
Maintainers
Readme
Travel UI Components
A collection of reusable React components for building travel and destination search interfaces.
Installation
```bash npm install @your-org/travel-components ```
Components
SearchBar
A search input with location icon and search button.
Props:
placeholder- Input placeholder textonSearch- Callback when search is triggereddefaultValue- Initial search value
CategoryFilters
Horizontal scrollable category buttons with selection state.
Props:
categories- Array of category objects with id, label, and optional iconselected- Currently selected category idonSelect- Callback when category is selected
DestinationCard
Card component for displaying destination images with optional title and subtitle.
Props:
image- Image URLtitle- Card titlesubtitle- Card subtitleonClick- Click handler
DestinationGrid
Grid layout for displaying multiple destination cards.
Props:
destinations- Array of destination objectscolumns- Number of columns (2, 3, or 4)onDestinationClick- Callback when destination is clicked
PromoBanner
Promotional banner with customizable colors and call-to-action.
Props:
title- Banner titlesubtitle- Banner subtitleimage- Optional banner imagectaText- Call-to-action button textbackgroundColor- Custom background colortextColor- Custom text coloronCtaClick- CTA button click handler
SearchHeader
Header component with title, subtitle, and optional profile image.
Props:
title- Header titlesubtitle- Optional subtitleprofileImage- User profile image URLuserName- User name for alt text
Usage
```tsx import { SearchBar, DestinationGrid, CategoryFilters } from '@your-org/travel-components' import { Plane, Hotel, Car } from 'lucide-react'
export default function Page() { const categories = [ { id: 'flights', label: 'Flights', icon: }, { id: 'hotels', label: 'Hotels', icon: }, { id: 'cars', label: 'Cars', icon: }, ]
const destinations = [ { id: '1', image: '/venice.jpg', title: 'Venice', subtitle: 'Italy' }, { id: '2', image: '/paris.jpg', title: 'Paris', subtitle: 'France' }, ]
return ( <SearchBar placeholder="Where do you want to go?" onSearch={(value) => console.log(value)} /> <CategoryFilters categories={categories} onSelect={(id) => console.log(id)} /> <DestinationGrid destinations={destinations} columns={4} onDestinationClick={(id) => console.log(id)} /> ) } ```
Styling
This library uses Tailwind CSS. Make sure your project has Tailwind CSS installed and configured.
Publishing
See PUBLISH.md for detailed publishing instructions.
License
MIT
