0
# UI Components
1
2
Comprehensive collection of Material Design components for building modern user interfaces with Vue.js.
3
4
## Capabilities
5
6
### Core UI Components
7
8
Essential user interface components for basic application needs.
9
10
```typescript { .api }
11
/** Application root component providing Material Design styling context */
12
const VApp: Component;
13
14
/** Material Design button component with multiple variants and states */
15
const VBtn: Component;
16
17
/** Material Design card container for content grouping */
18
const VCard: Component;
19
20
/** Card sub-components for structured content */
21
const VCardActions: Component;
22
const VCardItem: Component;
23
const VCardSubtitle: Component;
24
const VCardText: Component;
25
const VCardTitle: Component;
26
27
/** Alert component for displaying important messages */
28
const VAlert: Component;
29
const VAlertTitle: Component;
30
31
/** Avatar component for user profile images */
32
const VAvatar: Component;
33
34
/** Badge component for notification indicators */
35
const VBadge: Component;
36
37
/** Banner component for prominent notifications */
38
const VBanner: Component;
39
40
/** Chip component for tags and filters */
41
const VChip: Component;
42
const VChipGroup: Component;
43
44
/** Dialog modal component */
45
const VDialog: Component;
46
47
/** Divider line component */
48
const VDivider: Component;
49
50
/** Icon display component */
51
const VIcon: Component;
52
53
/** Image component with lazy loading and aspect ratio support */
54
const VImg: Component;
55
```
56
57
**Usage Examples:**
58
59
```typescript
60
// Basic button usage
61
<template>
62
<v-btn color="primary" size="large" @click="handleClick">
63
Click Me
64
</v-btn>
65
</template>
66
67
// Card with structured content
68
<template>
69
<v-card>
70
<v-card-title>Card Title</v-card-title>
71
<v-card-subtitle>Card Subtitle</v-card-subtitle>
72
<v-card-text>
73
Card content goes here
74
</v-card-text>
75
<v-card-actions>
76
<v-btn>Action</v-btn>
77
</v-card-actions>
78
</v-card>
79
</template>
80
81
// Alert with title
82
<template>
83
<v-alert type="success" variant="tonal">
84
<v-alert-title>Success!</v-alert-title>
85
Operation completed successfully.
86
</v-alert>
87
</template>
88
```
89
90
### Layout Components
91
92
Components for creating responsive layouts and organizing content.
93
94
```typescript { .api }
95
/** Grid container component for responsive layouts */
96
const VContainer: Component;
97
98
/** Grid row component */
99
const VRow: Component;
100
101
/** Grid column component with responsive breakpoint support */
102
const VCol: Component;
103
104
/** Flexible spacer component */
105
const VSpacer: Component;
106
107
/** Layout wrapper component */
108
const VLayout: Component;
109
110
/** Main content area component */
111
const VMain: Component;
112
113
/** Application footer component */
114
const VFooter: Component;
115
116
/** Base sheet/surface component for elevation and styling */
117
const VSheet: Component;
118
119
/** Responsive wrapper with aspect ratio support */
120
const VResponsive: Component;
121
```
122
123
**Usage Examples:**
124
125
```typescript
126
// Responsive grid layout
127
<template>
128
<v-container>
129
<v-row>
130
<v-col cols="12" md="6">
131
Column 1
132
</v-col>
133
<v-col cols="12" md="6">
134
Column 2
135
</v-col>
136
</v-row>
137
</v-container>
138
</template>
139
140
// Basic app layout
141
<template>
142
<v-app>
143
<v-layout>
144
<v-main>
145
<v-container>
146
App content
147
</v-container>
148
</v-main>
149
</v-layout>
150
</v-app>
151
</template>
152
```
153
154
### Input Components
155
156
Form input components with Material Design styling and validation.
157
158
```typescript { .api }
159
/** Base input component */
160
const VInput: Component;
161
162
/** Single-line text input field */
163
const VTextField: Component;
164
165
/** Multi-line text input area */
166
const VTextarea: Component;
167
168
/** Select dropdown component */
169
const VSelect: Component;
170
171
/** Combobox with free text input */
172
const VCombobox: Component;
173
174
/** Autocomplete input with filtering */
175
const VAutocomplete: Component;
176
177
/** Checkbox input component */
178
const VCheckbox: Component;
179
180
/** Radio button input */
181
const VRadio: Component;
182
183
/** Radio button group */
184
const VRadioGroup: Component;
185
186
/** Toggle switch component */
187
const VSwitch: Component;
188
189
/** Slider input component */
190
const VSlider: Component;
191
192
/** Range slider with dual handles */
193
const VRangeSlider: Component;
194
195
/** File upload input */
196
const VFileInput: Component;
197
198
/** Numeric input with controls */
199
const VNumberInput: Component;
200
201
/** One-time password input */
202
const VOtpInput: Component;
203
204
/** Base form field wrapper */
205
const VField: Component;
206
207
/** Form label component */
208
const VLabel: Component;
209
210
/** Selection control base component */
211
const VSelectionControl: Component;
212
213
/** Selection control group */
214
const VSelectionControlGroup: Component;
215
```
216
217
**Usage Examples:**
218
219
```typescript
220
// Text field with validation
221
<template>
222
<v-text-field
223
v-model="email"
224
label="Email"
225
type="email"
226
:rules="emailRules"
227
required
228
/>
229
</template>
230
231
// Select dropdown
232
<template>
233
<v-select
234
v-model="selectedItem"
235
:items="items"
236
label="Choose an option"
237
item-title="name"
238
item-value="id"
239
/>
240
</template>
241
242
// Checkbox group
243
<template>
244
<div>
245
<v-checkbox
246
v-model="selected"
247
label="Option 1"
248
value="option1"
249
/>
250
<v-checkbox
251
v-model="selected"
252
label="Option 2"
253
value="option2"
254
/>
255
</div>
256
</template>
257
```
258
259
### Display Components
260
261
Components for organizing and displaying content in various formats.
262
263
```typescript { .api }
264
/** Expandable content panel */
265
const VExpansionPanel: Component;
266
267
/** List display component */
268
const VList: Component;
269
270
/** Empty state illustration component */
271
const VEmptyState: Component;
272
273
/** Code display component with syntax highlighting */
274
const VCode: Component;
275
276
/** Counter display component */
277
const VCounter: Component;
278
279
/** Keyboard shortcut display */
280
const VKbd: Component;
281
282
/** Message display component */
283
const VMessages: Component;
284
285
/** Sparkline chart visualization */
286
const VSparkline: Component;
287
288
/** Rating display and input component */
289
const VRating: Component;
290
291
/** Timeline display component */
292
const VTimeline: Component;
293
294
/** Item group container */
295
const VItemGroup: Component;
296
297
/** Slide group container */
298
const VSlideGroup: Component;
299
300
/** Button group container */
301
const VBtnGroup: Component;
302
303
/** Button toggle group */
304
const VBtnToggle: Component;
305
```
306
307
**Usage Examples:**
308
309
```typescript
310
// List with items
311
<template>
312
<v-list>
313
<v-list-item
314
v-for="item in items"
315
:key="item.id"
316
:title="item.title"
317
:subtitle="item.subtitle"
318
/>
319
</v-list>
320
</template>
321
322
// Expansion panels
323
<template>
324
<v-expansion-panels>
325
<v-expansion-panel title="Panel 1">
326
Panel 1 content
327
</v-expansion-panel>
328
<v-expansion-panel title="Panel 2">
329
Panel 2 content
330
</v-expansion-panel>
331
</v-expansion-panels>
332
</template>
333
334
// Rating component
335
<template>
336
<v-rating
337
v-model="rating"
338
:length="5"
339
color="yellow-darken-3"
340
/>
341
</template>
342
```
343
344
### Overlay Components
345
346
Components for creating overlays, modals, and floating content.
347
348
```typescript { .api }
349
/** Base overlay component for backdrops and positioning */
350
const VOverlay: Component;
351
352
/** Tooltip overlay component */
353
const VTooltip: Component;
354
355
/** Context/dropdown menu */
356
const VMenu: Component;
357
358
/** Bottom sheet modal component */
359
const VBottomSheet: Component;
360
361
/** Hover state detection wrapper */
362
const VHover: Component;
363
364
/** Lazy loading wrapper */
365
const VLazy: Component;
366
367
/** No server-side rendering wrapper */
368
const VNoSsr: Component;
369
```
370
371
**Usage Examples:**
372
373
```typescript
374
// Tooltip
375
<template>
376
<v-tooltip text="Tooltip text">
377
<template #activator="{ props }">
378
<v-btn v-bind="props">
379
Hover me
380
</v-btn>
381
</template>
382
</v-tooltip>
383
</template>
384
385
// Menu
386
<template>
387
<v-menu>
388
<template #activator="{ props }">
389
<v-btn v-bind="props">
390
Open Menu
391
</v-btn>
392
</template>
393
<v-list>
394
<v-list-item title="Item 1" />
395
<v-list-item title="Item 2" />
396
</v-list>
397
</v-menu>
398
</template>
399
```
400
401
### Specialized Components
402
403
Components for specific use cases and advanced functionality.
404
405
```typescript { .api }
406
/** Color picker with palette */
407
const VColorPicker: Component;
408
409
/** Date selection picker */
410
const VDatePicker: Component;
411
412
/** Time selection picker */
413
const VTimePicker: Component;
414
415
/** Image/content carousel */
416
const VCarousel: Component;
417
418
/** Parallax scrolling effect */
419
const VParallax: Component;
420
421
/** Floating action button */
422
const VFab: Component;
423
424
/** Speed dial floating menu */
425
const VSpeedDial: Component;
426
427
/** Step-by-step wizard component */
428
const VStepper: Component;
429
430
/** Tab/window content container */
431
const VWindow: Component;
432
433
/** Pagination navigation */
434
const VPagination: Component;
435
436
/** Inline edit confirmation */
437
const VConfirmEdit: Component;
438
439
/** Validation wrapper component */
440
const VValidation: Component;
441
442
/** Component defaults provider */
443
const VDefaultsProvider: Component;
444
445
/** Theme context provider */
446
const VThemeProvider: Component;
447
448
/** Locale context provider */
449
const VLocaleProvider: Component;
450
```
451
452
**Usage Examples:**
453
454
```typescript
455
// Date picker
456
<template>
457
<v-date-picker
458
v-model="selectedDate"
459
:allowed-dates="allowedDates"
460
/>
461
</template>
462
463
// Stepper
464
<template>
465
<v-stepper v-model="step">
466
<v-stepper-header>
467
<v-stepper-item :complete="step > 1" step="1" title="Step 1" />
468
<v-divider />
469
<v-stepper-item :complete="step > 2" step="2" title="Step 2" />
470
</v-stepper-header>
471
472
<v-stepper-window v-model="step">
473
<v-stepper-window-item :value="1">
474
Step 1 content
475
</v-stepper-window-item>
476
<v-stepper-window-item :value="2">
477
Step 2 content
478
</v-stepper-window-item>
479
</v-stepper-window>
480
</v-stepper>
481
</template>
482
483
// Carousel
484
<template>
485
<v-carousel>
486
<v-carousel-item
487
v-for="item in items"
488
:key="item.id"
489
:src="item.image"
490
/>
491
</v-carousel>
492
</template>
493
```
494
495
## Types
496
497
```typescript { .api }
498
// Base component type
499
interface Component {
500
__vccOpts?: any;
501
[key: string]: any;
502
}
503
504
// Common component props
505
interface BaseProps {
506
class?: string;
507
style?: string | Record<string, any>;
508
id?: string;
509
}
510
511
// Color prop type
512
type Color = string | 'primary' | 'secondary' | 'accent' | 'error' | 'info' | 'success' | 'warning';
513
514
// Size prop type
515
type Size = 'x-small' | 'small' | 'default' | 'large' | 'x-large';
516
517
// Variant prop type
518
type Variant = 'elevated' | 'flat' | 'tonal' | 'outlined' | 'text' | 'plain';
519
520
// Density prop type
521
type Density = 'default' | 'comfortable' | 'compact';
522
523
// Position prop type
524
type Position = 'static' | 'relative' | 'fixed' | 'absolute' | 'sticky';
525
```