Developer
News and Updates
Get Support
Sign in
Get Support
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
UI Kit components
Jira UI Kit components
UI Kit hooks
Forge bridge APIs
Jira bridge APIs
Confluence bridge APIs
Dashboard bridge APIs
Upgrade UI Kit versions
Last updated Sep 25, 2026

useCurrentFilter (EAP)

Hook for accessing the filter represented by the currently open dropdown and its session-only override.

For module configuration and setup instructions, see Dashboard filter (EAP).

Installation

Install Forge hooks using the @forge/hooks npm package. Import @forge/hooks using a bundler, such as Webpack.

Usage

To add the useCurrentFilter hook to your app:

1
2
import { useCurrentFilter } from "@forge/hooks/dashboards";

Here is an example of accessing the currently open filter and override:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import React from "react";
import { useCurrentFilter } from "@forge/hooks/dashboards";

function CurrentFilter() {
  const { filter, override } = useCurrentFilter();

  if (!filter) {
    return null;
  }

  const filterLabel = "label" in filter ? filter.label : filter.id;

  return (
    <div>
      <p>Filter: {filterLabel}</p>
      <p>Selected values: {override?.values?.join(", ") ?? "None"}</p>
    </div>
  );
}

Function signature

1
2
3
4
5
6
7
function useCurrentFilter(): UseCurrentFilterResult;

interface UseCurrentFilterResult {
  filter: FilterExpression | null;
  override: FilterOverride | null;
}

For the FilterExpression and FilterOverride types, see the filter model.

Returns

  • filter (FilterExpression | null): The filter represented by the currently open dropdown, or null when no filter dropdown is open.
  • override (FilterOverride | null): The current session-only override for the filter, or null when no override exists.

Rate this page: