iRoachie / react-native-material-tabs

Material Design implementation of Tabs
MIT License
121 stars 56 forks source link

Indicator restricted to content #34

Closed JackHowa closed 4 years ago

JackHowa commented 6 years ago

Hi, this looks exactly what I've been looking for! Curious about the indicator restricted to content. Is this supported? I haven't seen a prop for this.

If not, do you have any recommendations for mimicking that behavior with your library?

target behavior/look: screen shot 2018-08-10 at 11 00 58 am

iRoachie commented 6 years ago

Looks like a neat feature to have. We'd have to find some way to measure the text content, and then based on that decide how much it needs to move by. I'd gladly support a PR for this

araujobarret commented 5 years ago

@iRoachie about the assets, do you have any advice for it? Maybe vector icons, or a source object passed by props, or something else?

iRoachie commented 5 years ago

@araujobarret Not sure what you are referring to. Do you mean changing the icons?

araujobarret commented 5 years ago

@iRoachie , sorry I wasn't too clear :grimacing: indicator restricted to content and icons next to labels have images or icons on it, so to enable these features we should allow to give the specific asset or an vector icon to be shown on each tab item. The lib from https://github.com/oblador/react-native-vector-icons has a ton of icons that we could use too.

We could pass the <Icon /> or the source prop of the <Image /> component as props <MaterialTabs /> , however to use the <Icon /> component we would need to import react-native-vector-icons.

Is just a thought before starting working on, btw idk if this is too clear to get my idea :laughing:

iRoachie commented 5 years ago

You can use any icons you want for the labels. We released this in v3.8.0. See https://github.com/iRoachie/react-native-material-tabs/pull/35#issue-209710002 for usage

araujobarret commented 5 years ago

Sorry I missed this part on readme.md

image

I will do an effort to work on it this week, create the tests for it and submit a PR with this feature :grimacing:

JackHowa commented 4 years ago

Looks like this working on an unrelated issue now