Car Search Small
Overview
The CarSearchSmall
component is a lightweight vehicle search form that provides a simplified interface with basic filtering options. It's designed for minimal space usage while still allowing users to search for vehicles by key criteria.
Installation
The component is part of the Carpose application and requires no separate installation.
Usage
To use the CarSearchSmall component in a standard HTML page:
Configuration Attributes
The component reads configuration from data attributes on the provided element:
data-carpose-component
string
-
Identifies the component type, must be set to "car-search-small"
data-api-key
string
-
API key for authentication with the Carpose backend services. Required for data fetching.
data-search-url-forward
string
null
URL to forward to when search button is clicked. Required for redirecting to the full search results page.
data-default-form-state-hash
string
null
Default form state hash to use when initializing the form. If not provided, a new empty form state will be created.
Features
Filtering by manufacturer, model, and condition
Real-time vehicle count display
Search button to redirect to full search results
Responsive layout that adapts to different screen sizes
Examples
Basic Example
With Default Form State
Behavior
Search Mode:
When the search button is clicked, the component redirects to the URL specified in
data-search-url-forward
with the form state hash appended.The full search page will load with the current filters applied.
Form Initialization:
The form is initialized with the default state from
data-default-form-state-hash
if provided.If not provided, an empty form state is created.
Real-time Count:
As filters are changed, the vehicle count updates in real-time to show available matches.
Integration with CarSearch
The CarSearchSmall component is typically used as an entry point to the full CarSearch component:
User selects basic filters (manufacturer, model, condition) in CarSearchSmall
User clicks the search button
Page redirects to the full CarSearch page with selected filters applied
User can further refine their search with additional filters
Last updated