Websites v4 docs v12.7.0
    Preparing search index...

    Interface UseSearchFormResult

    interface UseSearchFormResult {
        addTag: (tag: string) => void;
        distanceOptions: DistanceOption[];
        initialSearch: Search;
        maxBedroomOptions: BedroomOption[];
        maxPriceOptions: PriceOption[];
        maxSize: number | null;
        maxSizeOptions: SizeOption[];
        minBedroomOptions: BedroomOption[];
        minPriceOptions: PriceOption[];
        minSize: number | null;
        minSizeOptions: SizeOption[];
        priceFrequency: PriceFrequency;
        priceFrequencyOptions: { label: string; value: PriceFrequency }[];
        propertyTypeOptions: PropertyTypeOption[];
        removeTag: (tag: string) => void;
        removeTags: (tags: string[]) => void;
        search: Search;
        searchFormConfig: SectionElement | SearchForm | undefined;
        searching: boolean;
        setActiveSearchType: (searchType: string) => void;
        setChannel: (channel: string) => void;
        setDistance: (value: string | number | null) => void;
        setGeolocation: () => void;
        setMaxBedrooms: (value: string | number | null) => void;
        setMaxPrice: (value: string | number | null) => void;
        setMaxSize: (value: string | number | null) => void;
        setMinBedrooms: (value: string | number | null) => void;
        setMinPrice: (value: string | number | null) => void;
        setMinSize: (value: string | number | null) => void;
        setPriceFrequency: (frequency: PriceFrequency) => void;
        setPropertyType: (propertyType: string) => void;
        setSearchField: (
            payload: { [key: string]: string | number | null | undefined },
        ) => void;
        setSizeUnit: (unit: SizeUnit) => void;
        setSort: (value: string | null) => void;
        setStatus: (value: string | null) => void;
        setTags: (tags: string[]) => void;
        sizeUnit: SizeUnit;
        sizeUnitOptions: { label: string; value: SizeUnit }[];
        submitSearch: (e?: SyntheticEvent<Element, Event>, s?: Search) => void;
    }
    Index
    addTag: (tag: string) => void
    distanceOptions: DistanceOption[]
    initialSearch: Search
    maxBedroomOptions: BedroomOption[]
    maxPriceOptions: PriceOption[]
    maxSize: number | null
    maxSizeOptions: SizeOption[]
    minBedroomOptions: BedroomOption[]
    minPriceOptions: PriceOption[]
    minSize: number | null

    Current min/max size for the active unit

    minSizeOptions: SizeOption[]

    The size options for the active unit, already filtered against the opposite size value

    priceFrequency: PriceFrequency
    priceFrequencyOptions: { label: string; value: PriceFrequency }[]
    propertyTypeOptions: PropertyTypeOption[]
    removeTag: (tag: string) => void
    removeTags: (tags: string[]) => void
    search: Search

    The full local search state for the form

    searchFormConfig: SectionElement | SearchForm | undefined
    searching: boolean

    Boolean value to represent whether a search is running. Useful for rendering a loading state like a spinner.

    setActiveSearchType: (searchType: string) => void
    setChannel: (channel: string) => void
    setDistance: (value: string | number | null) => void
    setGeolocation: () => void
    setMaxBedrooms: (value: string | number | null) => void
    setMaxPrice: (value: string | number | null) => void
    setMaxSize: (value: string | number | null) => void
    setMinBedrooms: (value: string | number | null) => void
    setMinPrice: (value: string | number | null) => void
    setMinSize: (value: string | number | null) => void

    Writes to square feet or acreage depending on the active size unit

    setPriceFrequency: (frequency: PriceFrequency) => void
    setPropertyType: (propertyType: string) => void
    setSearchField: (
        payload: { [key: string]: string | number | null | undefined },
    ) => void

    Function to set individual search field values directly. This must be passed to the LocationInput as a prop.

    setSizeUnit: (unit: SizeUnit) => void

    Switching unit clears any size already entered, so only one unit is ever searched

    setSort: (value: string | null) => void
    setStatus: (value: string | null) => void
    setTags: (tags: string[]) => void
    sizeUnit: SizeUnit
    sizeUnitOptions: { label: string; value: SizeUnit }[]

    The units this form offers. Render a unit switcher only when there is more than one.

    submitSearch: (e?: SyntheticEvent<Element, Event>, s?: Search) => void

    Submit callback that should be added to the onSubmit handler of the search form