1
1
# React Smart Tab
2
- #### The awesome react tab control plugin
2
+ #### The awesome react tab component for ReactJS
3
3
4
4
[ ![ Build Status] ( https://travis-ci.org/techlab/react-smarttab.svg?branch=master )] ( https://travis-ci.org/techlab/react-smarttab )
5
5
[ ![ npm version] ( https://badge.fury.io/js/react-smarttab.svg )] ( https://badge.fury.io/js/react-smarttab )
6
6
[ ![ GitHub license] ( https://img.shields.io/badge/license-MIT-blue.svg )] ( https://raw.githubusercontent.com/techlab/react-smarttab/master/LICENSE )
7
7
[ ![ JavaScript Style Guide] ( https://img.shields.io/badge/code_style-standard-brightgreen.svg )] ( https://standardjs.com )
8
8
[ ![ Donate on Paypal] ( https://img.shields.io/badge/PayPal-dipuraj-blue.svg )] ( https://www.paypal.me/dipuraj )
9
9
10
- React Smart Tab is a flexible and heavily customizable ** React Tab control plugin ** .
10
+ React Smart Tab is a React component library for easy implementation of tab interface .
11
11
12
12
> If you think it is cool, you should also check it's sibling [ jQuery Smart Tab] ( http://techlaboratory.net/jquery-smarttab )
13
13
@@ -18,13 +18,13 @@ React Smart Tab is a flexible and heavily customizable **React Tab control plugi
18
18
19
19
Screenshots
20
20
-----
21
- ![ jQuery Smart Tab default ] ( http://techlaboratory.net/assets/media/jquery -smart-tab/smarttab-v3-default .png )
21
+ ![ jQuery Smart Tab pills ] ( http://techlaboratory.net/assets/media/react -smart-tab/react- smarttab-v2-pills .png )
22
22
23
- ![ jQuery Smart Tab dark] ( http://techlaboratory.net/assets/media/jquery -smart-tab/smarttab-v3 -dark.png )
23
+ ![ jQuery Smart Tab dark vertical ] ( http://techlaboratory.net/assets/media/react -smart-tab/react- smarttab-v2 -dark-vertical .png )
24
24
25
- ![ jQuery Smart Tab tabs ] ( http://techlaboratory.net/assets/media/jquery -smart-tab/smarttab-v3-tabs .png )
25
+ ![ jQuery Smart Tab default ] ( http://techlaboratory.net/assets/media/react -smart-tab/react- smarttab-v2-default .png )
26
26
27
- ![ jQuery Smart Tab brick] ( http://techlaboratory.net/assets/media/jquery -smart-tab/smarttab-v3 -brick.png )
27
+ ![ jQuery Smart Tab brick] ( http://techlaboratory.net/assets/media/react -smart-tab/react- smarttab-v2 -brick.png )
28
28
29
29
30
30
Installation
@@ -50,6 +50,7 @@ Features
50
50
+ Customizable CSS
51
51
+ Supports all modern browsers
52
52
+ Easy to implement
53
+ + Callback event support
53
54
54
55
Usage
55
56
-----
@@ -63,25 +64,78 @@ import 'react-smarttab/dist/index.css'
63
64
const App = () => {
64
65
65
66
return (
66
- < Tabs selected = ' tab-1 ' theme = ' dark ' orientation = ' vertical ' >
67
+ < Tabs>
67
68
< TabNav>
68
- < TabNavItem tab = " tab-1 " > Tab 1 < / TabNavItem>
69
- < TabNavItem tab = " tab-2 " > Tab 2 < / TabNavItem>
70
- < TabNavItem tab = " tab-3 " > Tab 3 < / TabNavItem>
71
- < TabNavItem tab = " tab-4 " > Tab 4 < / TabNavItem>
69
+ < TabNavItem> Tab 1 < / TabNavItem>
70
+ < TabNavItem> Tab 2 < / TabNavItem>
71
+ < TabNavItem> Tab 3 < / TabNavItem>
72
+ < TabNavItem> Tab 4 < / TabNavItem>
72
73
< / TabNav>
73
74
74
75
< TabContent>
75
- < TabPanel id = " tab-1 " >
76
+ < TabPanel>
76
77
Tab 1 Content
77
78
< / TabPanel>
78
- < TabPanel id = " tab-2 " >
79
+ < TabPanel>
79
80
Tab 2 Content
80
81
< / TabPanel>
81
- < TabPanel id = " tab-3 " >
82
+ < TabPanel>
82
83
Tab 3 Content
83
84
< / TabPanel>
84
- < TabPanel id= " tab-4" >
85
+ < TabPanel>
86
+ Tab 4 Content
87
+ < / TabPanel>
88
+ < / TabContent>
89
+ < / Tabs>
90
+ )
91
+ }
92
+
93
+ export default App
94
+ ```
95
+
96
+ Please see the [ documentation] ( http://techlaboratory.net/react-smarttab#documentation ) for more details on implementation and usage.
97
+
98
+ ##### Optional parameters
99
+
100
+ Please see the [ parameter descriptions] ( http://techlaboratory.net/react-smarttab#parameter-description ) for more details.
101
+
102
+ ``` jsx
103
+ import React from ' react'
104
+
105
+ import { Tabs , TabNav , TabNavItem , TabContent , TabPanel } from ' react-smarttab'
106
+ import ' react-smarttab/dist/index.css'
107
+
108
+ const App = () => {
109
+
110
+ return (
111
+ < Tabs
112
+ tabName= ' tab1'
113
+ selected= ' 0'
114
+ theme= ' dark'
115
+ orientation= ' horizontal
116
+ justified=' true '
117
+ enableURLhash={true}
118
+ onLeaveTab={(currentIndex, nextIndex) => { console.log("leaveTab", currentIndex, nextIndex) }}
119
+ onShowTab={(e) => { console.log("showTab", e) }}
120
+ >
121
+ <TabNav>
122
+ <TabNavItem>Tab 1</TabNavItem>
123
+ <TabNavItem>Tab 2</TabNavItem>
124
+ <TabNavItem>Tab 3</TabNavItem>
125
+ <TabNavItem>Tab 4</TabNavItem>
126
+ </TabNav>
127
+
128
+ <TabContent>
129
+ <TabPanel>
130
+ Tab 1 Content
131
+ </TabPanel>
132
+ <TabPanel>
133
+ Tab 2 Content
134
+ </TabPanel>
135
+ <TabPanel>
136
+ Tab 3 Content
137
+ </TabPanel>
138
+ <TabPanel>
85
139
Tab 4 Content
86
140
</TabPanel>
87
141
</TabContent>
0 commit comments