Skip to content

Add allowedRefreshIntervalUnits to EuiSuperDatePicker to disable unwanted refresh interval unit options #9258

@norbulcz

Description

@norbulcz

Requestor
Myself (external EUI consumer)

Problem Statement
EuiSuperDatePicker always shows the refresh interval units Seconds / Minutes / Hours, with no way to disable any of them.
In many non-Kibana applications, allowing “Seconds” is not desired or even supported. This creates UX confusion, unnecessary server load, and forces developers to clamp values manually while still exposing “Seconds” in the UI.

Proposed Solution
Add an optional, backwards-compatible prop:

allowedRefreshIntervalUnits?: Array<'s' | 'm' | 'h'>;

Default:

['s', 'm', 'h'] // current behavior, no change for Kibana

Example usage:

<EuiSuperDatePicker allowedRefreshIntervalUnits={['m', 'h']} />

If a unit is not included, it should simply not render in the refresh interval unit toggle.

Use Case
Any EUI consumer outside Kibana where seconds-level refresh is not allowed or not meaningful.
In my case, the backend enforces a minimum 1-minute refresh interval, so showing "Seconds" is misleading.

Value / Impact

Cleaner and more accurate UX

Prevents accidental high-frequency refreshes

Avoids CSS hacks or forks

Fully preserves Kibana behavior

Minimal change with high value for external users

Urgency
Moderate. Not blocking, but current workarounds are fragile and not ideal for production use.

Do alternatives or workarounds exist?
Yes, but none are good:

CSS to hide the “Seconds” button → fragile and not accessible

Related code or customizations
Current workaround is CSS-based hiding of the seconds unit, which is not stable long-term.

Additional context
This approach matches existing EUI patterns where components allow restricting available options (e.g., allowed positions/orientations).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions