Skip to content

[EuiSearchBar] Add top-level compressed prop, for both the search input and filter group #9712

@acstll

Description

@acstll

Requestor

@acstll

Problem Statement

EuiSearchBar renders its filters inside an EuiFilterGroup, but there is no way to set compressed on that group from the EuiSearchBar API. EuiFilterGroup already supports a compressed prop that reduces its height to match compressed form controls, but it is hardcoded without that prop in EuiSearchBarFilters. The search input (EuiFieldSearch) can be made compressed via box={{ compressed: true }}, but there is no equivalent for the filter buttons — and no single prop that makes the whole bar compact at once.

Proposed Solution

Add a top-level compressed prop to EuiSearchBarProps that drives both the search input and the filter group:

<EuiSearchBar filters={myFilters} compressed />

Internally, this would forward compressed to EuiFieldSearch (via box) and to EuiFilterGroup (via EuiSearchBarFilters). A consumer who needs fine-grained control can still override via box={{ compressed: false }}.

Use Case

Any product that places EuiSearchBar with filters inside a toolbar or header area that uses compressed-size form controls. Today, consumers must pass box={{ compressed: true }} for the input and have no opt-in at all for the filter buttons, leaving them at full height with no workaround short of CSS overrides.

Value / Impact

  • Enables visual consistency in dense or compact layouts with a single prop.
  • Low-effort change: EuiFilterGroup and EuiFieldSearch already support compressed — it just needs to be exposed one level up and threaded through.
  • It is very unlikely a consumer would want the input compressed but not the filters, or vice versa, so a unified prop matches the real-world use case.

Urgency

Nice-to-have; no hard deadline. Currently blocked by a missing API, not missing functionality in the underlying components.

Do alternatives or workarounds exist?

Partially. box={{ compressed: true }} compresses the search input, but there is no equivalent for the filter group. CSS overrides targeting .euiFilterGroup are the only current option for the filters, which is not stable.

Related code or customizations

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedThe EUI team is unlikely prioritize. (Don't delete - used for automation)low hanging fruitAn issue, often a bug, that is lower effort and clearly ought to be fixed
    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions