Nhảy tới nội dung

Skeleton

Cú pháp​

<zmp-skeleton-block> <zmp-skeleton-text> <zmp-skeleton-image> <zmp-skeleton-avatar>

Properties​

SkeletonBlock Properties​

SkeletonBlock sử dụng để tạo placeholder cho phần block. Có các thuộc tính sau:

PropTypeDefaultDescription
tagstring'div'HTML element tag
widthstringChiều rộng của block
heightstringChiều cao của block
border-radiusstringGiá trị thuộc tính border-radius css
effectstringHiệ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:

PropTypeDefaultDescription
tagstring'span'HTML element tag
effectstringHiệ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:

PropTypeDefaultDescription
tagstring'span'HTML element tag
widthnumberChiều rộng của skeleton image (SVG) theo px
heightnumberChiều cao của skeleton image (SVG) theo px
colorstringMàu sắc skeleton image
show-iconbooleantrueHiện/ Ẩn icon hình ảnh
icon-colorstringMàu sắc icon
border-radiusstringGiá trị thuộc tính border-radius
effectstringHiệ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:

PropTypeDefaultDescription
tagstring'span'HTML element tag
sizenumberKích thước skeleton avatar (SVG) theo px
colorstringMàu sắc skeleton avatar
show-iconbooleantrueHiện/ Ẩn icon
icon-colorstringMàu sắc icon
border-radiusstringGiá trị thuộc tính border-radius
effectstringHiệu ứng loading: 'fade', 'pulse' hoặc 'wave'

Ví dụ​

Code demo fallback when rendering server side!