File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -31,14 +31,15 @@ class Example extends React.Component {
3131## 👀 Properties
3232
3333| Property | Attribute | Description | Type | Default |
34- | -------------- | --------------- | ----------------------- | --------- | ----------- |
34+ | ---------------- | ----------------- | ------------------------- | ----------- | ------------- |
3535| ` width ` | ` width ` | Loader Width | ` string ` | ` "100%" ` |
3636| ` height ` | ` height ` | Loader Height | ` string ` | ` "1em" ` |
3737| ` background ` | ` background ` | Loader background color | ` string ` | ` "#eff1f6" ` |
3838| ` circle ` | ` circle ` | Make Skeleton Circle | ` boolean ` | ` false ` |
3939| ` borderRadius ` | ` border-radius ` | Loader radius | ` string ` | ` "4px" ` |
40- | ` block ` | ` block ` | Whether to start new | ` boolean ` | ` true ` |
40+ | ` block ` | ` block ` | Whether to start new | ` boolean ` | ` true ` |
4141| ` style ` | ` style ` | Extra Styles | ` object ` | ` {} ` |
42+ | ` as ` | -- | The HTML element | ` string ` | ` "div" ` |
4243
4344## License
4445
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ interface SkeletonLoaderProps {
1010 circle ?: boolean ;
1111 block ?: boolean ;
1212 style ?: React . CSSProperties ;
13+ as ?: keyof JSX . IntrinsicElements
1314}
1415
1516function SkeletonLoader ( {
@@ -20,9 +21,10 @@ function SkeletonLoader({
2021 circle = false ,
2122 block = true ,
2223 style = { } ,
24+ as : Tag = "div" ,
2325} : SkeletonLoaderProps ) {
2426 return (
25- < div
27+ < Tag
2628 className = { css . skeleton }
2729 style = { {
2830 width,
@@ -34,7 +36,7 @@ function SkeletonLoader({
3436 } }
3537 >
3638 ‌
37- </ div >
39+ </ Tag >
3840 ) ;
3941}
4042
You can’t perform that action at this time.
0 commit comments