Latest

FiltersSelected

Purpose

The FiltersSelected component is used to display a list of selected filters that can be easily removed and cleared.

Usage

import React from "react";
import { FiltersSelected } from "@usereactify/search";

import { ExampleFiltersSelected } from "./ExampleFiltersSelected";

export const Component: React.FC = () => {
  return (
    <FiltersSelected
      render={ExampleFiltersSelected}
    />
  );
};

Props

type FiltersSelectedProps = {
  /** Render method called once for all active filters */
  render?: React.FC<{
    selectedFilters: Array<{
      key: string;
      label: string;
      value:
        | Array<string>
        | string
        | { label: string; start: number; end: number }
        | Array<{ label: string; start: number; end: number }>;
    }>;
    handleRemove: (
      filterKey: string,
      filterValues?: Array<string | number>
    ) => void;
  }>;
};

Last updated