Skeleton
Skeleton Components
Bao gồm các components:
- SkeletonBlock
 - SkeletonText
 - SkeletonImage
 - SkeletonAvatar
 
Skeleton components Properties
SkeletonBlock properties
SkeletonBlock sử dụng để tạo placeholder cho phần block. Có các thuộc tính sau:
| Prop | Type | Default | Description | 
|---|---|---|---|
| tag | string | 'div' | HTML element tag | 
| width | string | Chiều rộng của block | |
| height | string | Chiều cao của block | |
| borderRadius | string | Giá trị thuộc tính border-radius css | |
| effect | string | Hiệu ứng loading: 'fade', 'pulse' hoặc 'wave' | 
SkeletonText properties
SkeletonText sử dụng để tạo placeholder cho phần văn bản. Có các thuộc tính sau:
| Prop | Type | Default | Description | 
|---|---|---|---|
| tag | string | 'span' | HTML element tag | 
| effect | string | Hiệu ứng loading: 'fade', 'pulse' hoặc 'wave' | 
SkeletonImage properties
SkeletonImage component được sử dụng làm placeholder cho hình ảnh. Có các thuộc tính sau:
| Prop | Type | Default | Description | 
|---|---|---|---|
| tag | string | 'span' | HTML element tag | 
| width | number | Chiều rộng của skeleton image (SVG) theo px | |
| height | number | Chiều cao của skeleton image (SVG) theo px | |
| color | string | Màu sắc skeleton image | |
| showIcon | boolean | true | Hiện/ Ẩn icon hình ảnh | 
| iconColor | string | Màu sắc icon | |
| borderRadius | string | Giá trị thuộc tính border-radius | |
| effect | string | Hiệu ứng loading: 'fade', 'pulse' hoặc 'wave' | 
SkeletonAvatar properties
SkeletonAvatar component được sử dụng làm placeholder cho avatar. Có các thuộc tính sau:
| Prop | Type | Default | Description | 
|---|---|---|---|
| tag | string | 'span' | HTML element tag | 
| size | number | Kích thước skeleton avatar (SVG) theo px | |
| color | string | Màu sắc skeleton avatar | |
| showIcon | boolean | true | Hiện/ Ẩn icon | 
| iconColor | string | Màu sắc icon | |
| borderRadius | string | Giá trị thuộc tính border-radius | |
| effect | string | Hiệu ứng loading: 'fade', 'pulse' hoặc 'wave' | 
Ví dụ
Code demo fallback when rendering server side!