@@ -5,8 +5,15 @@ Input elements have similar syntax to native HTML elements
55import {Input } from ' elementz' ;
66
77< Input .Group space>
8- < Input placeholder= ' Just a text input' / >
9- < Input type= ' password' placeholder= ' Just a password input' / >
8+ < Input
9+ placeholder= ' Just a text input'
10+ label= ' Text'
11+ / >
12+ < Input
13+ type= ' password'
14+ placeholder= ' Just a password input'
15+ label= ' Password'
16+ / >
1017< / Input .Group >
1118```
1219
@@ -17,8 +24,14 @@ I challenge you to type any character other than a number
1724import {Input , Badge } from ' elementz' ;
1825<>
1926
20- < Input type= ' number' incremental= {1 } max= {100 } onChange= {console .log .bind (null ," Change number:" )} / >
21- < small> Try scrolling on it< / small>
27+ < Input
28+ type= ' number'
29+ incremental= {1 }
30+ max= {100 }
31+ onChange= {console .log .bind (null ," Change number:" )}
32+ description= ' Try scrolling on it'
33+ / >
34+
2235
2336 < Input .Group className= ' mt-20' >
2437 < Input type= ' number' sm noButtons incremental= {1 } max= {100 }/ >
@@ -62,8 +75,7 @@ import {copy} from '../src/Functions/Functions';
6275const [show, setShow] = useState(false);
6376
6477<Input
65- active
66- readonly
78+ readOnly
6779 full
6880 spellCheck={false}
6981 after={<Icon name=' copy' />}
@@ -72,7 +84,7 @@ const [show, setShow] = useState(false);
7284 value={"bc1qte5dj2g04pzefxcwxu4gxvu83mmf5qsucnpl0n"}
7385 overlay={
7486 show ? (
75- <div className=' ez- bg- primary ez- animation- pop flex center ez- text- white w- 100 h- 100 ' >
87+ <div className=' ez- bg- primary ez- animation- pop flex center middle ez- text- white w- 100 h- 100 ' >
7688 Copied <Icon name=' checkmark' />
7789 </div>
7890 ) : null
@@ -90,6 +102,61 @@ const [show, setShow] = useState(false);
90102
91103```
92104
105+ ### Upload
106+ Make custom file uploaders by simply wrapping them
107+
108+ ```js
109+ import {Badge} from ' elementz' ;
110+ import React,{useState} from ' react' ;
111+
112+ const [image, setImage] = useState(' https: // i.imgur.com/sw9mJQo.png');
113+ const [path , setPath ] = useState (' ' );
114+
115+ < Input .Group space>
116+
117+ < Input
118+ type= ' file'
119+ accept= " image/png, image/gif, image/jpeg"
120+ onChange= {(e )=> {
121+ const files = e .target .files ;
122+ if (FileReader && files && files .length ) {
123+ var reader = new FileReader ();
124+ reader .onload = function () {
125+ setImage (reader .result );
126+ }
127+ reader .readAsDataURL (files[0 ]);
128+ }
129+ }}>
130+ < Badge
131+ circle
132+ className= ' upload-overlay'
133+ xl>
134+ < img
135+ src= {image}
136+ className= ' w-100'
137+ / >
138+ < / Badge>
139+ < / Input>
140+
141+ < Input
142+ type= ' file'
143+ onChange= {(e )=> (
144+ setPath (e .target .value )
145+ )}>
146+ < Input .Group >
147+ < Input
148+ type= ' text'
149+ placeholder= ' Choose a file'
150+ value= {path}
151+ className= ' clickable'
152+ readOnly
153+ / >
154+ < Badge icon= ' cloud-upload' / >
155+ < / Input .Group >
156+ < / Input>
157+
158+ < / Input .Group >
159+ ```
93160
94161
95162### States
@@ -105,39 +172,6 @@ import {Input, Icon, Badge, Button} from 'elementz';
105172< / Input .Group >
106173```
107174
108- ### Sizes
109-
110- ```js
111-
112- import {Input, Icon, Badge} from ' elementz' ;
113-
114-
115- <>
116- <Input.Group space ns>
117- <Input placeholder=' Just a text input' sm/>
118- <Input placeholder=' Just a text input' md/>
119- <Input placeholder=' Just a text input' lg/>
120- <Input placeholder=' Just a text input' xl/>
121-
122- </Input.Group>
123- <Input.Group space className=' mt- 5 ' ns>
124- <Input type=' checkbox' sm/>
125- <Input type=' checkbox' md disabled/>
126- <Input type=' checkbox' lg/>
127- <Input type=' checkbox' xl/>
128- <Input type=' radio' name=' radio' sm/>
129- <Input type=' radio' name=' radio' md/>
130- <Input type=' radio' name=' radio' lg/>
131- <Input type=' radio' name=' radio' xl/>
132-
133- <Input.Group full>
134- <Badge primary icon=' search' ></Badge>
135- <Input active primary full placeholder="A flexible width input"/>
136- </Input.Group>
137- </Input.Group>
138- </>
139- ```
140-
141175### Actions
142176``` js
143177import React , {useState } from ' react' ;
@@ -209,3 +243,55 @@ const [showPassword, setShowPassword] = useState(false);
209243< / Input .Group >
210244```
211245
246+ ### Sizes
247+
248+ ``` js
249+
250+ import {Input , Icon , Badge } from ' elementz' ;
251+
252+
253+ <>
254+ < Input .Group space ns>
255+ < Input placeholder= ' Just a text input' sm/ >
256+ < Input placeholder= ' Just a text input' md/ >
257+ < Input placeholder= ' Just a text input' lg/ >
258+ < Input placeholder= ' Just a text input' xl/ >
259+
260+ < / Input .Group >
261+ < Input .Group space className= ' mt-5' ns>
262+ < Input type= ' checkbox' sm/ >
263+ < Input type= ' checkbox' md disabled/ >
264+ < Input type= ' checkbox' lg/ >
265+ < Input type= ' checkbox' xl/ >
266+ < Input type= ' radio' name= ' radio' sm/ >
267+ < Input type= ' radio' name= ' radio' md/ >
268+ < Input type= ' radio' name= ' radio' lg/ >
269+ < Input type= ' radio' name= ' radio' xl/ >
270+
271+ < Input .Group full>
272+ < Badge primary icon= ' search' >< / Badge>
273+ < Input active primary full placeholder= " A flexible width input" / >
274+ < / Input .Group >
275+ < / Input .Group >
276+ < / >
277+ ```
278+
279+
280+ ### Labels
281+ ``` js
282+ < Input
283+ type= ' text'
284+ label= ' Username'
285+ description= ' The username is required'
286+ placeholder= ' @example'
287+ mb
288+ / >
289+
290+ < Input
291+ type= ' password'
292+ label= ' Password'
293+ description= ' Your secret password'
294+ mb
295+ / >
296+ ```
297+
0 commit comments