Skip to content

Commit 8f4ef6c

Browse files
committed
React Smart Tab v2.0.1
1 parent bb12f06 commit 8f4ef6c

25 files changed

+4760
-1551
lines changed

README.md

+69-15
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# React Smart Tab
2-
#### The awesome react tab control plugin
2+
#### The awesome react tab component for ReactJS
33

44
[![Build Status](https://travis-ci.org/techlab/react-smarttab.svg?branch=master)](https://travis-ci.org/techlab/react-smarttab)
55
[![npm version](https://badge.fury.io/js/react-smarttab.svg)](https://badge.fury.io/js/react-smarttab)
66
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/techlab/react-smarttab/master/LICENSE)
77
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
88
[![Donate on Paypal](https://img.shields.io/badge/PayPal-dipuraj-blue.svg)](https://www.paypal.me/dipuraj)
99

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.
1111

1212
> If you think it is cool, you should also check it's sibling [jQuery Smart Tab](http://techlaboratory.net/jquery-smarttab)
1313
@@ -18,13 +18,13 @@ React Smart Tab is a flexible and heavily customizable **React Tab control plugi
1818

1919
Screenshots
2020
-----
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)
2222

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)
2424

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)
2626

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)
2828

2929

3030
Installation
@@ -50,6 +50,7 @@ Features
5050
+ Customizable CSS
5151
+ Supports all modern browsers
5252
+ Easy to implement
53+
+ Callback event support
5354

5455
Usage
5556
-----
@@ -63,25 +64,78 @@ import 'react-smarttab/dist/index.css'
6364
const App = () => {
6465

6566
return (
66-
<Tabs selected='tab-1' theme='dark' orientation='vertical'>
67+
<Tabs>
6768
<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>
7273
</TabNav>
7374

7475
<TabContent>
75-
<TabPanel id="tab-1">
76+
<TabPanel>
7677
Tab 1 Content
7778
</TabPanel>
78-
<TabPanel id="tab-2">
79+
<TabPanel>
7980
Tab 2 Content
8081
</TabPanel>
81-
<TabPanel id="tab-3">
82+
<TabPanel>
8283
Tab 3 Content
8384
</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>
85139
Tab 4 Content
86140
</TabPanel>
87141
</TabContent>

0 commit comments

Comments
 (0)