@coveo/headless-react
    Preparing search index...

    Interface CoreCategoryFacet

    The CategoryFacet headless controller offers a high-level interface for designing a facet UI controller that renders values hierarchically.

    interface CoreCategoryFacet {
        state: CoreCategoryFacetState;
        deselectAll(): void;
        disable(): void;
        enable(): void;
        isSortedBy(criterion: CategoryFacetSortCriterion): boolean;
        showLessValues(): void;
        showMoreValues(): void;
        sortBy(criterion: CategoryFacetSortCriterion): void;
        subscribe(listener: () => void): Unsubscribe;
        toggleSelect(selection: CategoryFacetValue): void;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Deselects all facet values.

      Returns void

    • Disables the facet. I.e., prevents it from filtering results.

      Returns void

    • Enables the facet. I.e., undoes the effects of disable.

      Returns void

    • Checks whether the facet values are sorted according to the specified criterion.

      Parameters

      Returns boolean

      Whether the facet values are sorted according to the specified criterion.

    • Sets the number of values displayed in the facet to the originally configured value.

      Returns void

    • Increases the number of values displayed in the facet to the next multiple of the originally configured value.

      Returns void

    • Sorts the facet values according to the specified criterion.

      Parameters

      Returns void

    • Adds a callback that's invoked on state change.

      Parameters

      • listener: () => void

        A callback that's invoked on state change.

      Returns Unsubscribe

      A function to remove the listener.

    • Toggles the specified facet value.

      Parameters

      Returns void

    Properties

    The state of the Facet controller.