Property Search
SearchForm
The SearchForm
component should wrap all fields on your search form.
Here is an example of a complete search form:
Remember when you render your component to wrap it in the withHomeflowState
higher-order component to ensure it is passed the relevant state:
Props
defaultSort
: String
The default sort order for results. Can be one of the following strings:
least-expensive-first
most-expensive-first
most-recent-first
most-square-feet-first
least-square-feet-first
most-recently-launched-first
most-recently-updated-first
submitCallback
: Function
An optional callback that will be invoked when the form is submitted. It can be used for firing analytics events etc.
LocationInput
The LocationInput
component will render a search box complete with autosuggest functionality.
Props
Prop | Type | Description |
---|---|---|
handleSubmit | Function | Submit handler for the form. |
placeholder | String | The placeholder text displayed in the input. Default is 'Enter a location...' |
ChannelRadioButton
The ChannelRadioButton
component will render a single radio button for channel based on the type
provided.
Props
Prop | Type | Description |
---|---|---|
value | String | Should be 'sales' or 'lettings' |
PriceSelect
The PriceSelect
component will render a select for min or max price based on the type
provided.
The price options should change automatically based on the selected channel.
Pass the reactSelect
prop to render a decorated dropdown or omit it to render a normal select.
Props
Prop | Type | Description |
---|---|---|
type | String | Should be 'min' or 'max'. |
priceConfig | Object | Allows setting custom price options and other config (see below) |
reactSelect | Boolean | Whether to use the reac-select library to render a decorated dropdown |
priceConfig
priceConfig
can be used to set custom prices for sales and lettings. You can also include lettingsAs: 'pw'
to display lettings prices as per-week instead of per-month:
RadiusSelect
The RadiusSelect
component will render a dropdown for selecting radius.
Props
Prop | Type | Description |
---|---|---|
options | Array | An array of objects containing a label and value for each option to override the defaults |
reactSelect | Boolean | Whether to render a decorated dropdown |
BedroomsSelect
The BedroomsSelect
component will render min or max price select inputs.
Pass the reactSelect
prop to render a decorated dropdown or omit it to render a normal select.
Props
Prop | Type | Description |
---|---|---|
type | String | Should be 'min' or 'max'. |
bedValues | Array | You can override the default options for beds. |
reactSelect | Boolean | Whether to use the reac-select library to render a decorated dropdown |
bedValues
takes by default an array of numbers, however, it can also take an array of objects
with the structure { label: String, value: Number }
to provide search options such as { label: 'Studio', value: 0 }
GenericSearchField
If you need a form field for which there isn't a component provided, or you need more customisation, you can use the GenericSearchField
component.
By passing a type
prop, you can render either a text <input>
or a <select>
which will be hooked up to the relevant redux state and action (although make sure you only use valid camelCase homeflow search parameters as the name
).
This example will render a <select>
field to match properties created in a number of days:
SaveSearchButton
A button to add or remove (toggle) the current search to the user's saved searches.
SavedSearch
Useful in custom user profile systems where the user can manage their saved searches, this renders each search/alert with a dropdown to allow the user to change the alert frequency and links to visit or delete the search.
Props
search
- The search object.
Props
Prop | Type | Description |
---|---|---|
search | Object | The search object - is required |
visitSearchLabel | String | Label for viewing the search. Default: Visit |
removeSearchLabel | String | Label for deleting the search. Default: Remove |
frequencyLabel | String | Label for the dropdown values. Default: Email me matching properties: |
deleteButtonClass | String | Class for the delete search button |
visitButtonClass | String | Class for the visit search button |
selectClass | String | Class for the select/react select wrapper. |
reactSelect | Boolean | Whether to use the reac-select library to render a decorated dropdown |