8000 [Beta] EuiProvider componentDefaults functionality · Issue #8451 · elastic/eui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[Beta] EuiProvider componentDefaults functionality #8451
Open
0 of 1 issue completed
Open
Task
0 of 1 issue completed
@weronikaolejniczak

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.

634B
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    betaIssues for tracking beta functionalitiesmetaUsed to group similar requests or tracking. Not an Epic.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0