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

RFC: Tab, allow custom menuItem #1822

Closed
traverse opened this issue Jun 30, 2017 · 0 comments
Closed

RFC: Tab, allow custom menuItem #1822

traverse opened this issue Jun 30, 2017 · 0 comments
Labels

Comments

@traverse
Copy link
Contributor

The new Tab component is awesome but sometimes instead of the plain text menu item you might want to add for example a Label component to it.

It does currently works if you do the following:

import React from 'react'
import { Label, MenuItem, Tab } from 'semantic-ui-react'

const panes = [
  {
    menuItem: <MenuItem>Tab1<Label>2</Label></MenuItem>,
    render: () => <Tab.Pane>Tab 1 Content</Tab.Pane>
  }
]

const TabExampleBasic = () => (
  <Tab panes={panes} />
)

export default TabExampleBasic

You do however get a prop type warning. I'm not sure if it's just a matter of changing menuItem: PropTypes.string.isRequired to menuItem: PropTypes.node.isRequired or if any other changes are required.

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

No branches or pull requests

2 participants