Chuyển tới nội dung chính

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:

PropTypeDefaultDescription
tagstring'div'HTML element tag
widthstringChiều rộng của block
heightstringChiều cao của block
borderRadiusstringGiá 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
showIconbooleantrueHiện/ Ẩn icon hình ảnh
iconColorstringMàu sắc icon
borderRadiusstringGiá 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
showIconbooleantrueHiện/ Ẩn icon
iconColorstringMàu sắc icon
borderRadiusstringGiá 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!