Skip to content

[Beta] EuiProvider componentDefaults functionality #8451

Open
0 of 1 issue completed
Open

Description

@weronikaolejniczak

componentDefaults functionality stems from a feature request: #6922. It has been partially tackled on #6995 for a limited amount of components. It's in beta status to verify the usability and predictability of the feature. The purpose of this task is to analyze the next steps necessary to move it out of beta.

Feature description

componentDefaults is a prop of the EuiProvider component. It accepts an object where the key are EUI components (currently EuiPortal | EuiFocusTrap | EuiTablePagination | EuiTable) and the value is an object with default properties (a limited amount, e.g. for EuiPortal we only accept a value for the insert prop).

The values we pass for the above-mentioned components will be reflected in the whole component tree under the EuiProvider.

export type EuiComponentDefaults = {
/**
* Provide a global configuration for EuiPortal's default insertion position.
*/
EuiPortal?: Pick<EuiPortalProps, 'insert'>;
/**
* Provide a global configuration for EuiFocusTrap's `gapMode` and `crossFrame` props
*/
EuiFocusTrap?: Pick<EuiFocusTrapProps, 'gapMode' | 'crossFrame'>;
/**
* Provide global settings for EuiTablePagination's props that affect page size
* / the rows per page selection.
*
* These defaults will be inherited all table and grid components that utilize EuiTablePagination.
*/
EuiTablePagination?: Pick<
EuiTablePaginationProps,
'itemsPerPage' | 'itemsPerPageOptions' | 'showPerPageOptions'
>;
/**
* Provide a global configuration for EuiTable's `responsiveBreakpoint` prop. Defaults to `'s'`.
*
* Defaults will be inherited by all `EuiBasicTable`s and `EuiInMemoryTable`s.
*/
EuiTable?: Pick<EuiTableProps, 'responsiveBreakpoint'>;
};

Goal

As part of this ticket, we should test out usage and developer experience, and plan accordingly for improvements, and potentially extending the scope of functionality to include more components.

Possible beta outcomes

Sub-issues

Sub-issues

0 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    beta
    on Mar 18, 2025
  2. added
    meta
    on May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    betameta

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions