-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathApp.js
executable file
·111 lines (110 loc) · 5.57 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import React from 'react';
import ReactDOM from 'react-dom';
import {Tabs, Tab} from 'react-bootstrap-tabs';
ReactDOM.render((
<div className="container">
<div>
<h2>React Bootstrap 4 Tab demo</h2>
<p>
Demonstrates the <a href="https://github.com/freeranger/react-bootstrap-tabs.git">Bootstrap 4 react tab component</a>.
</p>
<p>
Look at the source code of this page to see the markup for each example.
</p>
</div>
<div className="row">
<section>
<h5>No Tabs</h5>
<Tabs className="tab-container-with-border"></Tabs>
<p>
There is also a custom class on the entire tab container.
</p>
</section>
</div>
<hr/>
<div className="row">
<section>
<h5>Single Tab</h5>
<Tabs>
<Tab label="tab 1">One lonely tab</Tab>
</Tabs>
</section>
</div>
<hr/>
<div className="row">
<section>
<h5>Multiple Tabs, custom CSS styles</h5>
<Tabs style={{border:'2px solid green'}} headerStyle={{fontWeight: 'bold'}} activeHeaderStyle={{color:'blue'}} contentStyle={{backgroundColor:'lightgoldenrodyellow'}}>
<Tab label="Container style" >Tabs container has a green border<br/><br/>
<pre><Tabs style={"{{border:'2px solid green'}}"}></pre>
</Tab>
<Tab label="Header style">All the tab headers have a bold font, the active tab header has a blue font<br/><br/>
<pre><Tabs headerStyle={"{{fontWeight: 'bold'}}"} activeHeaderStyle={"{{color: 'blue'}}"}></pre>
</Tab>
<Tab label="Tab Style" style={{color:'green'}}>The tab contents have a yellow background and this one specifically has green aligned text<br/><br/>
<pre><Tabs contentStyle={"{{backgroundColor:'lightgoldenrodyellow'}}"}><br/>
<Tab style={"{{textAlign: 'right'}}"} /><br/>
</Tabs></pre>
</Tab>
</Tabs>
</section>
</div>
<hr/>
<div className="row">
<section>
<h5>Multiple Tabs, custom CSS classes</h5>
<Tabs className="tab-container-with-green-border" headerClass="tab-header-bold" activeHeaderClass="tab-header-blue" contentClass="tab-content-yellow">
<Tab label="Container style" >Tabs container has a green border<br/><br/>
<pre><Tabs className="..."></pre>
</Tab>
<Tab label="Header style">All the tab headers have a bold font, the active tab header has a blue font<br/><br/>
<pre>.tab-header-bold {"{"}<br/>
font-weight: bold;<br/>
{"}"}<br/>
.nav-tabs a.tab-header-blue.active {"{"}<br/>
color: blue;<br/>
{"}"}<br/><br/>
<Tabs headerClass="tab-header-bold" activeHeaderClass="tab-header-blue"></pre>
</Tab>
<Tab label="Tab Style" className="tab-content-green">The tab contents have a yellow background and this one specifically has green aligned text<br/><br/>
<pre><Tabs contentClass="..."><br/>
<Tab className="..." /><br/>
</Tabs></pre>
</Tab>
</Tabs>
</section>
</div>
<hr/>
<div className="row">
<section>
<h5>Multiple Tabs, default selection</h5>
<Tabs contentClass="tab-content-default" onSelect={(index, label) => console.log(`Selected Index: ${index}, Label: ${label}`)}>
<Tab label="tab 1">This is Tab 1</Tab>
<Tab label="tab 2" className="my-tab-content">This is Tab 2 with a custom content class</Tab>
<Tab label="Disabled" disabled></Tab></Tabs>
</section>
</div>
<hr/>
<div className="row">
<section>
<h5>Multiple Tabs, selected by index</h5>
<Tabs onSelect={(index, label) => console.log(`Selected Index: ${index}, Label: ${label}`)} selected={1}>
<Tab label="tab 1">This is Tab 1</Tab>
<Tab headerClass="my-tab-header" activeHeaderClass="my-active-tab-header" label="tab 2">This is Tab 2 with custom header classes (active & normal)</Tab>
<Tab label="tab 3">This is Tab 3</Tab>
</Tabs>
</section>
</div>
<hr/>
<div className="row">
<section>
<h5>Multiple Tabs, selected by label</h5>
<Tabs onSelect={(index, label) => console.log(`Selected Index: ${index}, Label: ${label}`)} selected="tab 2">
<Tab label="tab 1">This is Tab 1</Tab>
<Tab label="tab 2">This is Tab 2</Tab>
<Tab label="Disabled" disabled></Tab>
</Tabs>
</section>
</div>
</div>
), document.getElementById('app'));