mui / mui/base-ui

[tooltip] Optional features tree-shaking

Open
#1,792 2 comments 5 reactions 0 assignees View on GitHub
component: tooltip performance type: enhancement
Dominant language
TypeScript
Stars
10.9k
Forks
543
Avg merge
1d 20h
Merged PRs (30d)
101

Description

# Feature request

Currently, there are optional features that are part of components that add a bunch of bundle size even if not used. `trackCursorAxis` on `Tooltip` is one such example.

If we want to add more features to Tooltip like truncation logic, `inline()` logic, etc, this adds further cost but most users don't need that by default and shouldn't need to incur.

One possible solution is a `features` prop where you pass in 'features' using imports so bundlers can remove them if they aren't called:

```jsx

```

Another is component providers:

```jsx



```

This would only apply to non-essential features, as there will still be a baseline of expected behavior and props

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.