项目作者: techlab

项目描述 :
The awesome react tab component for ReactJS
高级语言: CSS
项目地址: git://github.com/techlab/react-smarttab.git
创建时间: 2020-06-12T16:46:28Z
项目社区:https://github.com/techlab/react-smarttab

开源协议:Other

下载


React Smart Tab

The awesome react tab component for ReactJS

Build Status
npm version
GitHub license
JavaScript Style Guide
Donate on Paypal

React Smart Tab is a React component library for easy implementation of tab interface.

If you think it is cool, you should also check it’s sibling jQuery Smart Tab

Screenshots

jQuery Smart Tab pills

jQuery Smart Tab dark vertical

jQuery Smart Tab default

jQuery Smart Tab brick

Installation

NPM

  1. npm install react-smarttab --save

Yarn

  1. yarn add react-smarttab

Features

  • Responsive design
  • Standalone CSS
  • Bootstrap compatible
  • Various themes included
  • Customizable CSS
  • Supports all modern browsers
  • Easy to implement
  • Callback event support

Usage

  1. import React from 'react'
  2. import { Tabs, TabNav, TabNavItem, TabContent, TabPanel } from 'react-smarttab'
  3. import 'react-smarttab/dist/index.css'
  4. const App = () => {
  5. return (
  6. <Tabs>
  7. <TabNav>
  8. <TabNavItem>Tab 1</TabNavItem>
  9. <TabNavItem>Tab 2</TabNavItem>
  10. <TabNavItem>Tab 3</TabNavItem>
  11. <TabNavItem>Tab 4</TabNavItem>
  12. </TabNav>
  13. <TabContent>
  14. <TabPanel>
  15. Tab 1 Content
  16. </TabPanel>
  17. <TabPanel>
  18. Tab 2 Content
  19. </TabPanel>
  20. <TabPanel>
  21. Tab 3 Content
  22. </TabPanel>
  23. <TabPanel>
  24. Tab 4 Content
  25. </TabPanel>
  26. </TabContent>
  27. </Tabs>
  28. )
  29. }
  30. export default App

Please see the documentation for more details on implementation and usage.

Optional parameters

Please see the parameter descriptions for more details.

  1. import React from 'react'
  2. import { Tabs, TabNav, TabNavItem, TabContent, TabPanel } from 'react-smarttab'
  3. import 'react-smarttab/dist/index.css'
  4. const App = () => {
  5. return (
  6. <Tabs
  7. tabName='tab1'
  8. selected='0'
  9. theme='dark'
  10. orientation='horizontal
  11. justified='true'
  12. enableURLhash={true}
  13. onLeaveTab={(currentIndex, nextIndex) => { console.log("leaveTab", currentIndex, nextIndex) }}
  14. onShowTab={(e) => { console.log("showTab", e) }}
  15. >
  16. <TabNav>
  17. <TabNavItem>Tab 1</TabNavItem>
  18. <TabNavItem>Tab 2</TabNavItem>
  19. <TabNavItem>Tab 3</TabNavItem>
  20. <TabNavItem>Tab 4</TabNavItem>
  21. </TabNav>
  22. <TabContent>
  23. <TabPanel>
  24. Tab 1 Content
  25. </TabPanel>
  26. <TabPanel>
  27. Tab 2 Content
  28. </TabPanel>
  29. <TabPanel>
  30. Tab 3 Content
  31. </TabPanel>
  32. <TabPanel>
  33. Tab 4 Content
  34. </TabPanel>
  35. </TabContent>
  36. </Tabs>
  37. )
  38. }
  39. export default App

License

MIT License

Contribute

If you like the project please support with your contribution.

Donate on Paypal

Thank you and Happy Coding!