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

Implement Tab Component #20

Open
manojktechie opened this issue Apr 15, 2017 · 4 comments
Open

Implement Tab Component #20

manojktechie opened this issue Apr 15, 2017 · 4 comments

Comments

@manojktechie
Copy link

https://github.com/material-components/material-components-web/tree/feat/mdc-tabs/packages/mdc-tabs

@kradio3
Copy link
Owner

kradio3 commented Apr 15, 2017

thanks, @manoj150283

@gasolin
Copy link

gasolin commented Jun 14, 2017

@manoj150283 do you have an example for tab component with Toolbar?

@kradio3
Copy link
Owner

kradio3 commented Jun 15, 2017

Hi @gasolin ,
This example works for me:

        <Toolbar 
          fixed
          z={4} 
        >
          <ToolbarSection>
            <Tabbar>
              <Tab 
                active={this.state.activeTab===1}
                onClick={() => {this.setState({activeTab:1})}}
              >
                Item One
              </Tab>
              <Tab 
                active={this.state.activeTab===2}
                onClick={() => {this.setState({activeTab:2})}}
              >
                Item Two
              </Tab>
              <Tab 
                active={this.state.activeTab===3}
                onClick={() => {this.setState({activeTab:3})}}
              >
                Item Three
              </Tab>
            </Tabbar>
          </ToolbarSection>
        </Toolbar>

@gasolin
Copy link

gasolin commented Jun 17, 2017

@kradio3 thanks it works, though if I wrap the tab text content with <a> or Link from react-router-dom, the Tab will looks like a url but not the tab anymore. Not sure if its intended.

The workaround now is adding extra style in each link to inherit the style.

const linkStyle = {
  color: "inherit",
  textDecoration: "inherit",
}

<Tab>
<Link style={linkStyle}></Link>
</Tab>

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

No branches or pull requests

3 participants