File tree Expand file tree Collapse file tree 6 files changed +63
-21
lines changed Expand file tree Collapse file tree 6 files changed +63
-21
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,20 @@ export const componentConfig = {
2020 filePath : "preview/components/avatar-style-circle.tsx" ,
2121 preview : lazy ( ( ) => import ( "@/preview/components/avatar-style-circle" ) ) ,
2222 } ,
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+ } ,
2337 "badge-style-default" : {
2438 name : "badge-style-default" ,
2539 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
2727
2828## Examples
2929
30- ### Circle
30+ ### Size variants
3131
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<
3737 < AvatarPrimitive . Fallback
3838 ref = { ref }
3939 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 " ,
4141 className
4242 ) }
4343 { ...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";
22
33export default function AvatarStyleCircle ( ) {
44 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 >
239 ) ;
2410}
You can’t perform that action at this time.
0 commit comments