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 {
31
31
## 👀 Properties
32
32
33
33
| Property | Attribute | Description | Type | Default |
34
- | -------------- | --------------- | ----------------------- | --------- | ----------- |
34
+ | ---------------- | ----------------- | ------------------------- | ----------- | ------------- |
35
35
| ` width ` | ` width ` | Loader Width | ` string ` | ` "100%" ` |
36
36
| ` height ` | ` height ` | Loader Height | ` string ` | ` "1em" ` |
37
37
| ` background ` | ` background ` | Loader background color | ` string ` | ` "#eff1f6" ` |
38
38
| ` circle ` | ` circle ` | Make Skeleton Circle | ` boolean ` | ` false ` |
39
39
| ` 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 ` |
41
41
| ` style ` | ` style ` | Extra Styles | ` object ` | ` {} ` |
42
+ | ` as ` | -- | The HTML element | ` string ` | ` "div" ` |
42
43
43
44
## License
44
45
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ interface SkeletonLoaderProps {
10
10
circle ?: boolean ;
11
11
block ?: boolean ;
12
12
style ?: React . CSSProperties ;
13
+ as ?: keyof JSX . IntrinsicElements
13
14
}
14
15
15
16
function SkeletonLoader ( {
@@ -20,9 +21,10 @@ function SkeletonLoader({
20
21
circle = false ,
21
22
block = true ,
22
23
style = { } ,
24
+ as : Tag = "div" ,
23
25
} : SkeletonLoaderProps ) {
24
26
return (
25
- < div
27
+ < Tag
26
28
className = { css . skeleton }
27
29
style = { {
28
30
width,
@@ -34,7 +36,7 @@ function SkeletonLoader({
34
36
} }
35
37
>
36
38
‌
37
- </ div >
39
+ </ Tag >
38
40
) ;
39
41
}
40
42
You can’t perform that action at this time.
0 commit comments