File tree 6 files changed +63
-21
lines changed
6 files changed +63
-21
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,20 @@ export const componentConfig = {
20
20
filePath : "preview/components/avatar-style-circle.tsx" ,
21
21
preview : lazy ( ( ) => import ( "@/preview/components/avatar-style-circle" ) ) ,
22
22
} ,
23
+ "avatar-style-circle-fallbacks" : {
24
+ name : "avatar-style-fallbacks" ,
25
+ filePath : "preview/components/avatar-style-circle-fallbacks.tsx" ,
26
+ preview : lazy (
27
+ ( ) => import ( "@/preview/components/avatar-style-circle-fallbacks" )
28
+ ) ,
29
+ } ,
30
+ "avatar-style-circle-sizes" : {
31
+ name : "avatar-style-circle-sizes" ,
32
+ filePath : "preview/components/avatar-style-circle-sizes.tsx" ,
33
+ preview : lazy (
34
+ ( ) => import ( "@/preview/components/avatar-style-circle-sizes" )
35
+ ) ,
36
+ } ,
23
37
"badge-style-default" : {
24
38
name : "badge-style-default" ,
25
39
filePath : "preview/components/badge-style-default.tsx" ,
Original file line number Diff line number Diff line change @@ -27,6 +27,18 @@ npm install @radix-ui/react-avatar
27
27
28
28
## Examples
29
29
30
- ### Circle
30
+ ### Size variants
31
31
32
- <ComponentShowcase name = " avatar-style-circle" />
32
+ <ComponentShowcase name = " avatar-style-circle-sizes" />
33
+
34
+ <br />
35
+ <br />
36
+
37
+ ### Fallbacks
38
+
39
+ Fallbacks are helpfull when there ia an error loading the src of the avatar.
40
+ You can set fallbacks with ` Avatar.Fallback ` component.
41
+
42
+ <br />
43
+
44
+ <ComponentShowcase name = " avatar-style-circle-fallbacks" />
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ const AvatarFallback = React.forwardRef<
37
37
< AvatarPrimitive . Fallback
38
38
ref = { ref }
39
39
className = { cn (
40
- "flex h-full w-full items-center justify-center rounded-full bg-muted" ,
40
+ "flex h-full w-full items-center justify-center rounded-full bg-muted bg-primary-400 " ,
41
41
className
42
42
) }
43
43
{ ...props }
Original file line number Diff line number Diff line change
1
+ import { Avatar } from "@/packages/ui" ;
2
+
3
+ export default function AvatarStyleFallback ( ) {
4
+ return (
5
+ < Avatar >
6
+ < Avatar . Image src = "broken-link" alt = "Arif Logs" />
7
+ < Avatar . Fallback > AH</ Avatar . Fallback >
8
+ </ Avatar >
9
+ ) ;
10
+ }
Original file line number Diff line number Diff line change
1
+ import { Avatar } from "@/packages/ui" ;
2
+
3
+ export default function AvatarStyleCircle ( ) {
4
+ return (
5
+ < div className = "flex items-center space-x-4" >
6
+ < Avatar >
7
+ < Avatar . Image src = "/images/avatar.jpeg" alt = "Arif Logs" />
8
+ < Avatar . Fallback > AH</ Avatar . Fallback >
9
+ </ Avatar >
10
+ < Avatar className = "h-16 w-16" >
11
+ < Avatar . Image src = "/images/avatar.jpeg" alt = "Arif Logs" />
12
+ < Avatar . Fallback > AH</ Avatar . Fallback >
13
+ </ Avatar >
14
+ < Avatar className = "h-20 w-20" >
15
+ < Avatar . Image src = "/images/avatar.jpeg" alt = "Arif Logs" />
16
+ < Avatar . Fallback > AH</ Avatar . Fallback >
17
+ </ Avatar >
18
+ </ div >
19
+ ) ;
20
+ }
Original file line number Diff line number Diff line change @@ -2,23 +2,9 @@ import { Avatar } from "@/packages/ui";
2
2
3
3
export default function AvatarStyleCircle ( ) {
4
4
return (
5
- < div className = "flex items-center space-x-4" >
6
- < Avatar className = "h-10 w-10" >
7
- < Avatar . Image src = "/images/avatar.jpeg" alt = "Arif Logs" />
8
- < Avatar . Fallback > AH</ Avatar . Fallback >
9
- </ Avatar >
10
- < Avatar >
11
- < Avatar . Image src = "/images/avatar.jpeg" alt = "Arif Logs" />
12
- < Avatar . Fallback > AH</ Avatar . Fallback >
13
- </ Avatar >
14
- < Avatar className = "h-16 w-16" >
15
- < Avatar . Image src = "/images/avatar.jpeg" alt = "Arif Logs" />
16
- < Avatar . Fallback > AH</ Avatar . Fallback >
17
- </ Avatar >
18
- < Avatar className = "h-20 w-20" >
19
- < Avatar . Image src = "/images/avatar.jpeg" alt = "Arif Logs" />
20
- < Avatar . Fallback > AH</ Avatar . Fallback >
21
- </ Avatar >
22
- </ div >
5
+ < Avatar >
6
+ < Avatar . Image src = "/images/avatar.jpeg" alt = "Arif Logs" />
7
+ < Avatar . Fallback > AH</ Avatar . Fallback >
8
+ </ Avatar >
23
9
) ;
24
10
}
You can’t perform that action at this time.
0 commit comments