PedroBern / react-native-collapsible-tab-view

A cross-platform Collapsible Tab View component for React Native
MIT License
830 stars 161 forks source link

Tab Indicator size based on dynamic Tab Item Width #217

Closed JaitenThomas closed 2 years ago

JaitenThomas commented 2 years ago

Feature request

Wanting the Tab Indicator size to be dynamic based Tab Item width, similar to twitter

Current behavior

The tab item indicator is based on a division of number of tabs evenly

Screenshots (if applicable)

Screenshot_20211123-202251_Twitter

JaitenThomas commented 2 years ago

Or is it possible to just have a react navigation tab navigator and somehow connect the indicator to the current tabs screen elements?

PedroBern commented 2 years ago

The indicator width is already dynamically set, see the scrollable example.

Relevant code: https://github.com/PedroBern/react-native-collapsible-tab-view/blob/main/src/MaterialTabBar/Indicator.tsx#L36-L43

https://user-images.githubusercontent.com/39778068/143154526-77621b76-d4a0-4689-b135-5b9003b93e90.mp4

PedroBern commented 2 years ago

@JaitenThomas Feel free to reopen if you mean when sceoll is disabled.