Toggle
Toggle renders a Toggle Checkbox in a Card element providing a filter for the performed search.
Usage
<Toggle
title="Versions"
label="View all versions"
filterValue={['all_versions', 'true']}
/>
Props
-
title
StringoptionalThe optional title for the Card element.
-
label
labeloptionalAn optional label to for the Checkbox element.
-
filterValue
ArrayAn array containing the filter to be applied to the search query when active.
-
overridableId
StringoptionalAn optional string to define a specific overridable id.
Usage when overriding
const MyCount = ({ totalResults }) => {
return <div>Found {totalResults} results.</div>;
}
const overriddenComponents = {
"SearchFilters.ToggleComponent.element": MyCount
};
Parameters
-
title
StringoptionalThe optional title for the Card element.
-
label
labeloptionalAn optional label to for the Checkbox element.
-
filterValue
ArrayAn array containing the filter to be applied to the search query when active.
-
userSelectionFilters
ArrayThe list of currently selected filters by the user.
-
updateQueryFilters
FunctionThe function to call to add or remove a filter from the list of selected ones
updateQueryFilters(filter).