[Beta] EuiProvider componentDefaults functionality
- Dominant language
- TypeScript
- Stars
- 6.4k
- Forks
- 911
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 69
Description
`componentDefaults` functionality stems from a feature request: https://github.com/elastic/eui/discussions/6922. It has been partially tackled on https://github.com/elastic/eui/pull/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`.
https://github.com/elastic/eui/blob/bfe1fed3e2be5c9add6c32b513830aefabcf99e8/packages/eui/src/components/provider/component_defaults/component_defaults.tsx#L21-L46
## 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
- reach a functionality stability and fair usage with the current component pool,
- [accept specific requests for configurable component defaults](https://github.com/elastic/eui/discussions/6922),
- configure all props across all EUI components to accept custom consumer defaults.
Contributor guide
Assessment
This issue has not been assessed yet.