-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform.html
622 lines (501 loc) · 32.6 KB
/
form.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
<!DOCTYPE html>
<html lang="en-gb" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Form - UIkit tests</title>
<script src="js/test.js"></script>
</head>
<body>
<div class="uk-container">
<h1>Form</h1>
<div uk-grid>
<div class="uk-width-2-3@s">
<h2>Horizontal</h2>
<form class="uk-form-horizontal">
<div class="uk-margin">
<label class="uk-form-label" for="form-h-text">Text</label>
<div class="uk-form-controls">
<input class="uk-input uk-form-width-large" id="form-h-text" type="text" placeholder="Some text...">
</div>
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-h-select">Select</label>
<div class="uk-form-controls">
<select class="uk-select uk-form-width-large" id="form-h-select">
<option>Option 01</option>
<option>Option 02</option>
</select>
</div>
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-h-datalist">Datalist</label>
<div class="uk-form-controls">
<input class="uk-input uk-form-width-large" id="form-h-datalist" list="datalist" type="text" placeholder="Some text...">
<datalist id="datalist">
<option value="Chrome"></option>
<option value="Edge"></option>
<option value="Firefox"></option>
<option value="Safari"></option>
</datalist>
</div>
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-h-textarea">Textarea</label>
<div class="uk-form-controls">
<textarea class="uk-textarea uk-form-width-large" id="form-h-textarea" rows="5" placeholder="Some text..."></textarea>
</div>
</div>
<div class="uk-margin">
<span class="uk-form-label">Radio</span>
<div class="uk-form-controls uk-form-controls-text">
<label><input class="uk-radio" type="radio" name="radio1"> Option 01</label><br>
<label><input class="uk-radio" type="radio" name="radio1"> Option 02</label>
<div class="uk-margin uk-grid-small uk-child-width-auto" uk-grid>
<label><input class="uk-radio" type="radio" name="radio2"> A</label>
<label><input class="uk-radio" type="radio" name="radio2"> B</label>
<label><input class="uk-radio" type="radio" name="radio2"> C</label>
<label><input class="uk-radio" type="radio" name="radio2"> D</label>
</div>
</div>
</div>
<div class="uk-margin">
<span class="uk-form-label">Checkbox</span>
<div class="uk-form-controls uk-form-controls-text">
<label><input class="uk-checkbox" type="checkbox"> Option 01</label><br>
<label><input class="uk-checkbox" type="checkbox"> Option 02</label>
<div class="uk-margin uk-grid-small uk-child-width-auto" uk-grid>
<label><input class="uk-checkbox" type="checkbox"> A</label>
<label><input class="uk-checkbox" type="checkbox"> B</label>
<label><input class="uk-checkbox" type="checkbox"> C</label>
<label><input class="uk-checkbox" type="checkbox"> D</label>
</div>
</div>
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-h-multiple">Multiple</label>
<div class="uk-form-controls">
<select class="uk-select uk-form-width-large" id="form-h-multiple" multiple>
<option>Option 01</option>
<option>Option 02</option>
<option>Option 03</option>
<option>Option 04</option>
</select>
</div>
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-h-range">Range</label>
<div class="uk-form-controls uk-form-controls-text">
<input class="uk-range uk-form-width-large" id="form-h-range" type="range" value="2" min="0" max="10" step="0.1">
</div>
</div>
</form>
<h2>Sizes</h2>
<form>
<div class="uk-margin" uk-margin>
<textarea class="uk-textarea uk-form-width-small uk-form-large" rows="2" placeholder="Some text..." aria-label="Large"></textarea>
<input class="uk-input uk-form-width-small uk-form-large" type="text" placeholder="Some text..." aria-label="Large">
<select class="uk-select uk-form-width-small uk-form-large" aria-label="Large">
<option>Option 01</option>
<option>Option 02</option>
</select>
<button class="uk-button uk-button-default uk-button-large">Button</button>
<label><input class="uk-checkbox" type="checkbox"> Checkbox</label>
</div>
<div class="uk-margin" uk-margin>
<textarea class="uk-textarea uk-form-width-small" rows="2" placeholder="Some text..." aria-label="Default"></textarea>
<input class="uk-input uk-form-width-small" type="text" placeholder="Some text..." aria-label="Default">
<select class="uk-select uk-form-width-small" aria-label="Default">
<option>Option 01</option>
<option>Option 02</option>
</select>
<button class="uk-button uk-button-default">Button</button>
<label><input class="uk-checkbox" type="checkbox"> Checkbox</label>
</div>
<div class="uk-margin" uk-margin>
<textarea class="uk-textarea uk-form-width-small uk-form-small" rows="2" placeholder="Some text..." aria-label="Small"></textarea>
<input class="uk-input uk-form-width-small uk-form-small" type="text" placeholder="Some text..." aria-label="Small">
<select class="uk-select uk-form-width-small uk-form-small" aria-label="Small">
<option>Option 01</option>
<option>Option 02</option>
</select>
<button class="uk-button uk-button-default uk-button-small">Button</button>
<label><input class="uk-checkbox" type="checkbox"> Checkbox</label>
</div>
</form>
<h2>Widths</h2>
<form>
<div class="uk-margin" uk-margin>
<input class="uk-input uk-form-width-large" type="text" placeholder="form-width-large" aria-label="Width large">
</div>
<div class="uk-margin" uk-margin>
<select class="uk-select uk-form-width-large" aria-label="Width large">
<option>form-width-large</option>
</select>
</div>
<div class="uk-margin" uk-margin>
<textarea class="uk-textarea uk-form-width-large" rows="1" placeholder="form-width-large" aria-label="Width large"></textarea>
</div>
<div class="uk-margin" uk-margin>
<input class="uk-input uk-form-width-medium" type="text" placeholder="form-width-medium" aria-label="Width medium">
<input class="uk-input uk-form-width-small" type="text" placeholder="form-width-small" aria-label="Width small">
<input class="uk-input uk-form-width-xsmall" type="text" placeholder="form-width-xsmall" aria-label="Width xsmall">
</div>
<div class="uk-margin" uk-margin>
<select class="uk-select uk-form-width-medium" aria-label="Width medium">
<option>form-width-medium</option>
</select>
<select class="uk-select uk-form-width-small" aria-label="Width small">
<option>form-width-small</option>
</select>
<select class="uk-select uk-form-width-xsmall" aria-label="Width xsmall">
<option>form-width-xsmall</option>
</select>
</div>
<div class="uk-margin" uk-margin>
<textarea class="uk-textarea uk-form-width-medium" rows="1" placeholder="form-width-medium" aria-label="Width medium"></textarea>
<textarea class="uk-textarea uk-form-width-small" rows="1" placeholder="form-width-small" aria-label="Width small"></textarea>
</div>
</form>
<h2>Icon</h2>
<form class="uk-form-stacked uk-child-width-auto@m" uk-grid>
<div>
<div class="uk-margin">
<span class="uk-form-label">Not clickable</span>
<div class="uk-inline">
<span class="uk-form-icon" uk-icon="icon: user"></span>
<input class="uk-input uk-form-width-medium" type="text" aria-label="Not clickable icon">
</div>
</div>
<div class="uk-margin">
<div class="uk-inline">
<span class="uk-form-icon uk-form-icon-flip" uk-icon="icon: lock"></span>
<input class="uk-input uk-form-width-medium" type="text" aria-label="Not clickable icon">
</div>
</div>
</div>
<div>
<div class="uk-margin">
<span class="uk-form-label">Clickable</span>
<div class="uk-inline">
<a class="uk-form-icon" href="#" uk-icon="icon: pencil"></a>
<input class="uk-input" type="text" aria-label="Clickable icon">
</div>
</div>
<div class="uk-margin">
<div class="uk-inline">
<a class="uk-form-icon uk-form-icon-flip" href="#" uk-icon="icon: link"></a>
<input class="uk-input" type="text" aria-label="Clickable icon">
</div>
</div>
</div>
</form>
<h2>Select</h2>
<select class="uk-select uk-form-width-large" aria-label="Select">
<option>Option 01</option>
<option>Option 02</option>
</select>
<p class="uk-margin-small">
<select class="uk-select uk-form-width-large" aria-label="Select disabled" disabled>
<option>Option 01</option>
<option>Option 02</option>
</select>
</p>
<p class="uk-margin-small">
<select class="uk-select uk-form-width-large" aria-label="Select multiple" multiple>
<option>Option 01</option>
<option>Option 02</option>
<option>Option 03</option>
<option>Option 04</option>
</select>
</p>
<h2>Radio, Checkbox and Select</h2>
<form class="uk-form-stacked uk-child-width-1-3@m" uk-grid>
<div>
<span class="uk-form-label">Radio</span>
<label><input class="uk-radio" type="radio" name="radio1" checked> Checked</label><br>
<label><input class="uk-radio" type="radio" name="radio1"> Unchecked</label><br>
<label><input class="uk-radio" type="radio" name="radio1"> Unchecked</label><br>
<label><input class="uk-radio" type="radio" name="radio2" disabled> Disabled</label><br>
<label><input class="uk-radio" type="radio" name="radio2" disabled checked> Disabled Checked</label>
<div class="uk-margin uk-grid-small uk-child-width-auto" uk-grid>
<label><input class="uk-radio" type="radio" name="radio3" checked> A</label>
<label><input class="uk-radio" type="radio" name="radio3"> B</label>
<label><input class="uk-radio" type="radio" name="radio4" disabled> C</label>
<label><input class="uk-radio" type="radio" name="radio4" disabled checked> D</label>
</div>
</div>
<div>
<span class="uk-form-label">Checkbox</span>
<label><input class="uk-checkbox" type="checkbox" checked> Checked</label><br>
<label><input class="uk-checkbox" type="checkbox"> Unchecked</label><br>
<label><input class="uk-checkbox" type="checkbox"> Unchecked</label><br>
<label><input class="uk-checkbox" type="checkbox" disabled> Disabled</label><br>
<label><input class="uk-checkbox" type="checkbox" disabled checked> Disabled Checked</label><br>
<div class="uk-margin uk-grid-small uk-child-width-auto" uk-grid>
<label><input class="uk-checkbox" type="checkbox" checked> A</label>
<label><input class="uk-checkbox" type="checkbox"> B</label>
<label><input class="uk-checkbox" type="checkbox" disabled> C</label>
<label><input class="uk-checkbox" type="checkbox" disabled checked> D</label>
</div>
</div>
<div>
<span class="uk-form-label">Checkbox</span>
<label><input class="uk-checkbox js-indeterminate" type="checkbox"> Indeterminate</label><br>
<label><input class="uk-checkbox" type="checkbox"> Unchecked</label><br>
<label><input class="uk-checkbox" type="checkbox"> Unchecked</label><br>
<label><input class="uk-checkbox" type="checkbox" disabled> Disabled</label><br>
<label><input class="uk-checkbox js-indeterminate" type="checkbox" disabled> Disabled Indeterminate</label>
<div class="uk-margin uk-grid-small uk-child-width-auto" uk-grid>
<label><input class="uk-checkbox js-indeterminate" type="checkbox"> A</label>
<label><input class="uk-checkbox" type="checkbox"> B</label>
<label><input class="uk-checkbox" type="checkbox" disabled> C</label>
<label><input class="uk-checkbox js-indeterminate" type="checkbox" disabled> D</label>
</div>
<script>UIkit.util.$$('.js-indeterminate').forEach(el => { el.indeterminate = true; })</script>
</div>
</form>
<h2>Custom Controls</h2>
<form class="uk-form-stacked uk-child-width-1-2@m" uk-grid>
<div>
<h3>File</h3>
<div class="uk-margin">
<div uk-form-custom>
<input type="file" aria-label="Custom controls">
<button class="uk-button uk-button-default" type="button" tabindex="-1">Select</button>
</div>
</div>
<div class="uk-margin">
<span class="uk-text-middle">Here is a text</span>
<div uk-form-custom>
<input type="file" aria-label="Custom controls">
<span class="uk-link">upload</span>
</div>
</div>
<div class="uk-margin" uk-margin>
<div uk-form-custom="target: true">
<input type="file" aria-label="Custom controls">
<input class="uk-input uk-form-width-medium" type="text" placeholder="Select file" disabled>
</div>
<button class="uk-button uk-button-default">Submit</button>
</div>
</div>
<div>
<h3>Select</h3>
<div class="uk-margin">
<div uk-form-custom="target: true">
<select aria-label="Custom controls">
<option value="1">Option 01</option>
<option value="2">Option 02</option>
<option value="3">Option 03</option>
<option value="4">Option 04</option>
</select>
<span></span>
</div>
</div>
<div class="uk-margin">
<div uk-form-custom="target: > * > span:last-child">
<select aria-label="Custom controls">
<option value="1">Option 01</option>
<option value="2">Option 02</option>
<option value="3">Option 03</option>
<option value="4">Option 04</option>
</select>
<span class="uk-link">
<span uk-icon="icon: pencil"></span>
<span></span>
</span>
</div>
</div>
<div class="uk-margin">
<div uk-form-custom="target: > * > span:first-child">
<select aria-label="Custom controls">
<option value="">Please select...</option>
<option value="1">Option 01</option>
<option value="2">Option 02</option>
<option value="3">Option 03</option>
<option value="4">Option 04</option>
</select>
<button class="uk-button uk-button-default" type="button" tabindex="-1">
<span></span>
<span uk-icon="icon: chevron-down"></span>
</button>
</div>
</div>
<div class="uk-margin">
<div uk-form-custom="target: true">
<select aria-label="Custom controls">
<option value="">Please select...</option>
<option value="1">Option 01</option>
<option value="2">Option 02</option>
<option value="3">Option 03</option>
<option value="4">Option 04</option>
</select>
<span class="uk-select uk-form-width-medium"></span>
</div>
</div>
</div>
</form>
<p><span class="uk-label">Note</span> The hover and focus state for <code>uk-form-custom</code> are not styled by default, but you could use the adjacent sibling selector to do so.</p>
</div>
<form class="uk-form-stacked uk-width-1-3@s">
<h2>Stacked</h2>
<div class="uk-margin">
<span class="uk-form-label">States and styles</span>
<div class="uk-margin-small uk-grid-small uk-child-width-1-2" uk-grid>
<div>
<input class="uk-input" type="text" placeholder=":disabled" aria-label="disabled" disabled>
</div>
<div>
<input class="uk-input" type="text" placeholder=":disabled" aria-label="disabled" value="Some text..." disabled>
</div>
</div>
<div class="uk-margin-small uk-grid-small" uk-grid>
<div class="uk-width-expand">
<input class="uk-input" type="text" placeholder=":focus" aria-label="focus" autofocus required>
</div>
<div class="uk-width-auto">
<button class="uk-button uk-button-default uk-width-1-1">Required</button>
</div>
</div>
<div class="uk-margin-small">
<input class="uk-input uk-form-danger" type="text" placeholder="form-danger" aria-label="form-danger" value="form-danger">
</div>
<div class="uk-margin-small">
<input class="uk-input uk-form-success" type="text" placeholder="form-success" aria-label="form-success" value="form-success">
</div>
<div class="uk-margin-small">
<input class="uk-input uk-form-blank" type="text" placeholder="form-blank" aria-label="form-blank">
</div>
</div>
<fieldset class="uk-fieldset">
<legend class="uk-legend">Legend</legend>
<div class="uk-margin">
<label class="uk-form-label" for="form-s-text">Text</label>
<input class="uk-input" id="form-s-text" type="text" placeholder="Some text...">
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-s-select">Select</label>
<select class="uk-select" id="form-s-select">
<option>Option 01</option>
<option>Option 02</option>
</select>
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-s-textarea">Textarea</label>
<textarea class="uk-textarea" id="form-s-textarea" rows="5" placeholder="Some text..."></textarea>
</div>
<div class="uk-margin">
<span class="uk-form-label">Radio</span>
<label><input class="uk-radio" type="radio" name="radio1"> Option 01</label><br>
<label><input class="uk-radio" type="radio" name="radio1"> Option 02</label>
<div class="uk-margin uk-grid-small uk-child-width-auto" uk-grid>
<label><input class="uk-radio" type="radio" name="radio2"> A</label>
<label><input class="uk-radio" type="radio" name="radio2"> B</label>
<label><input class="uk-radio" type="radio" name="radio2"> C</label>
<label><input class="uk-radio" type="radio" name="radio2"> D</label>
</div>
</div>
<div class="uk-margin">
<span class="uk-form-label">Checkbox</span>
<label><input class="uk-checkbox" type="checkbox"> Option 01</label><br>
<label><input class="uk-checkbox" type="checkbox"> Option 02</label>
<div class="uk-margin uk-grid-small uk-child-width-auto" uk-grid>
<label><input class="uk-checkbox" type="checkbox"> A</label>
<label><input class="uk-checkbox" type="checkbox"> B</label>
<label><input class="uk-checkbox" type="checkbox"> C</label>
<label><input class="uk-checkbox" type="checkbox"> D</label>
</div>
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-s-multiple">Multiple</label>
<select class="uk-select" id="form-s-multiple" multiple>
<option>Option 01</option>
<option>Option 02</option>
<option>Option 03</option>
<option>Option 04</option>
</select>
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-s-range">Range</label>
<input class="uk-range" id="form-s-range" type="range" value="2" min="0" max="10" step="0.1">
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-s-number">Number</label>
<input class="uk-input" id="form-s-number" type="number" min="0" max="10" value="5">
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-s-password">Password</label>
<input class="uk-input" id="form-s-password" type="password" placeholder="Password">
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-s-email">Email</label>
<input class="uk-input" id="form-s-email" type="email" placeholder="name@domain.com">
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-s-search">Search</label>
<input class="uk-input" id="form-s-search" type="search" placeholder="Search">
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-s-tel">Tel</label>
<input class="uk-input" id="form-s-tel" type="tel" placeholder="+49 555 123456">
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-s-url">URL</label>
<input class="uk-input" id="form-s-url" type="url" placeholder="http://">
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-s-file">File</label>
<input class="uk-width-1-1" id="form-s-file" type="file">
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-s-color">Color</label>
<input class="uk-input" id="form-s-color" type="color">
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-s-date">Date</label>
<input class="uk-input" id="form-s-date" type="date">
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-s-month">Month</label>
<input class="uk-input" id="form-s-month" type="month">
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-s-week">Week</label>
<input class="uk-input" id="form-s-week" type="week">
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-s-time">Time</label>
<input class="uk-input" id="form-s-time" type="time">
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-s-datetimelocal">Datetime local</label>
<input class="uk-input" id="form-s-datetimelocal" type="datetime-local">
</div>
</fieldset>
</form>
</div>
<h2>JavaScript Options</h2>
<div class="uk-overflow-auto">
<table class="uk-table uk-table-striped">
<thead>
<tr>
<th>Option</th>
<th>Value</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>target</code></td>
<td>CSS selector, Boolean</td>
<td>false</td>
<td>Value display target.</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>