Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TabBar Component #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

META-DREAMER
Copy link
Collaborator

Initial version of the tab bar component. Could use some refactoring to make it more modular and ‘panza-ey’. Still need to write docs but example component is there. Wait till i get the docs done to merge it but lemme know what you think of it so far

@bmcmahen
Copy link
Collaborator

bmcmahen commented Jun 28, 2016

Looks like a great start.

Some initial thoughts:

  • I'm thinking we should rely more on using Animated instead of LayoutAnimation, in part because it's more reliable on Android, and because it doesn't exist for the web (with the eventual goal of providing a react-native-web compatible release).
  • Do we want swipe behaviour? (like you'd find with Material)

If it was swipeable, we could make the tabs optional, and it could also act as a carousel, which is something that I'd find useful.

@META-DREAMER
Copy link
Collaborator Author

I used layout animation for performance reasons since it doesn't run animations on the JS thread. I can change it to use Animated instead, shouldn't be too big of a deal as long as JS thread isnt busy.

I think we should leave any advanced interactions like swipe behavior up to the user/other libraries and keep this just a UI library. If someone wants swipable paging integrated with tab bar, they're better of using something like this: https://github.com/skv-headless/react-native-scrollable-tab-view.

Even this tab bar component makes me feel a bit iffy, anything stateful seems like it could be problematic. For now I think we should focus on the more low level stuff right now and really nailing the design/structure. I think we should partition the components into three categories: Elements, Views and Modules and work on them in that order. Elements being the basic components like Text and Buttons and Icons, Views being the composed components like NavBar and InputRow/Group, and Modules being the interactive/stateful components like checkboxes, Tab bar, carousels etc. My inspiration for this is semantic-ui.com which is IMO the best designed and easiest to use UI library I've ever worked with and I think we could use a lot of good ideas from it.

@bmcmahen
Copy link
Collaborator

Yeah, LayoutAnimation has better performance now, but Animated will run off-thread soon so it shouldn't be much of an issue going forward.

I like the distinction between Elements, Views, and Modules. I wasn't familiar with semantic-ui. It does, indeed, look like a good source of inspiration. And I think you're probably right that we should keep things lean for now. Something like react-native-scrollable-tab-view probably provides better functionality than we could without significant effort, and instead we should provide the stylized pieces that can plug in to other third party modules. At the end of the day, though, I do want to provide the basic building blocks of an application -- which was really the original intent of this library., ie., a basic collection of widgets that I've built along the way for use in my various RN projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants