Skip to content

Commit

Permalink
docs(README.md): Add Custom Components documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
EmaSuriano committed Feb 21, 2018
1 parent fbdda68 commit 44c5dd1
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,37 @@ When using the UMD version of react-tabs you can easily use the default styles b
</html>
```
### Custom
### Custom Style
You can also always just simply copy the default style to your own css/scss/less and modify it to your own needs. The changelog will always tell you when classes change and we also consider changes that break the styling as semver major.
### Custom Components
In case you want to create your own component wrapping the ones that the library provides, you have to set its `tabsRole`. This is value is used inside react-tabs to check the role of a component inside `Tabs`.
``` javascript
import { Tabs, TabList, Tab, TabPanel } from 'react-tabs';
const CustomTab = ({ children }) => (
<Tab>
<h1>{children}</h1>
</Tab>
);
CustomTab.tabsRosle = 'Tab'; // Required field to use your custom Tab
const App = () => (
<Tabs>
<TabList>
<CustomTab>Custom Tab 1</CustomTab>
<CustomTab>Custom Tab 2</CustomTab>
</TabList>
<TabPanel>Panel 1</TabPanel>
<TabPanel>Panel 2</TabPanel>
</Tabs>
);
```
## License
MIT

0 comments on commit 44c5dd1

Please sign in to comment.