forked from Stanko/react-slider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
87 lines (77 loc) · 2.71 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>React slider</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" href="//stanko.github.io/skyblue/css/skyblue.css">
<link rel="stylesheet" href="slider.css">
<style>
.ExampleSliders .Slider-slides > div {
padding: 100px 0;
font-size: 100px;
line-height: 100px;
height: 300px;
color: #fff;
text-align: center;
}
.Slider {
margin: 15px 0 40px;
}
</style>
</head>
<body>
<div class="container margin-y-40">
<h1>React slider</h1>
<p>
Simple, no bull***t React slider component with touch support and 0 dependencies.
Just put your slides in it. Modern browsers and IE10+
(IE9 should work, but as flex is not supported you'll need to change CSS).
</p>
<h5 class="margin-bottom-20"><a href="https://github.com/Stanko/react-slider">Download on GitHub</a></h5>
<div id="slider1"></div>
<h3>Features</h3>
<ul>
<li>Lightweight, <i>no dependencies</i></li>
<li>Navigation, pager and arrows</li>
<li>Swipe support, with velocity detection</li>
<li>Easily customizable ~200 LOC</li>
</ul>
<h3>Usage</h3>
<p>
Include JS/CSS files, and in your React app wrap you slider in
<code><Slider></code> Component.
</p>
<pre>
<<span class="color-error">Slider</span>>
{/* Slides */}
<<span class="color-error">div</span>> A </<span class="color-error">div</span>>
<<span class="color-error">div</span>> B </<span class="color-error">div</span>>
<<span class="color-error">div</span>> C </<span class="color-error">div</span>>
</<span class="color-error">Slider</span>>
</pre>
<h3>Default props</h3>
<ul>
<li><code>loop: false</code> - Should arrow navigation loop around</li>
<li><code>selected: 0</code> - Slide to be selected</li>
<li><code>showArrows: true</code> - Show arrows navigation</li>
<li><code>showNav: true</code> - Show pager navigation</li>
</ul>
<p>
Any of the props can be dynamically changed.
</p>
<pre>
<<span class="color-error">Slider</span>
<span class="color-main">loop</span>={ <span class="color-success">false</span> }
<span class="color-main">selected</span>={ <span class="color-success">0</span> }
<span class="color-main">showArrows</span>={ <span class="color-success">true</span> }
<span class="color-main">showNav</span>={ <span class="color-success">true</span> }>
</pre>
<div id="slider2" class="margin-top-40"></div>
</div>
<script src="lib/react.js"></script>
<script src="lib/react-dom.js"></script>
<script src="lib/babel-browser-5.8.23.min.js"></script>
<script type="text/babel" src="slider.js"></script>
</body>
</html>