diff --git a/apps/www/components/preview/index.tsx b/apps/www/components/preview/index.tsx index b6757b3..da12e13 100644 --- a/apps/www/components/preview/index.tsx +++ b/apps/www/components/preview/index.tsx @@ -33,7 +33,7 @@ export default { ), avatar: ( -
+
- This component uses __absolute__ and __relative__ positioning so that in our **MDX** docs - the component is not visible properly, but it's fine to use in your project. - - issue: [#9](https://github.com/ruru-m07/ruru-ui/issues/9) - -if you can fix this then feel free to submit a PR : ) - - ## Usage @@ -95,7 +84,17 @@ The `AvatarGroup` component is used to display multiple avatars in a group. { src: "https://github.com/rauchg.png", alt: "rauchg" }, { src: "https://github.com/shadcn.png", alt: "shadcn" }, ]} + className={"mb-5"} size={40} + style={{ + display: "flex", + gap: "20px", + justifyContent: "center", + alignItems: "center", + padding: "0px", + }} + aClassName="-ml-[26px] " + lnClassName="-ml-[26px] " /> @@ -157,20 +174,44 @@ The `AvatarGroup` component is used to display multiple avatars in a group. The `AvatarWithBadge` component is used to display an avatar with a badge. - + diff --git a/packages/ui/src/components/avatar.tsx b/packages/ui/src/components/avatar.tsx index 19a21db..41dc75a 100644 --- a/packages/ui/src/components/avatar.tsx +++ b/packages/ui/src/components/avatar.tsx @@ -135,10 +135,16 @@ type AvatarGroupProps = Omit< * */ limit?: number; + + aClassName?: string; + lnClassName?: string; }; const AvatarGroup = React.forwardRef( - ({ className, size = 30, members, limit, ...props }, ref) => { + ( + { className, aClassName, lnClassName, size = 30, members, limit, ...props }, + ref, + ) => { const displayedMembers = limit && members.length > limit ? members.slice(0, limit - 1) : members; const extraMembersCount = @@ -149,7 +155,7 @@ const AvatarGroup = React.forwardRef( {displayedMembers.map((member, index) => ( ( {extraMembersCount > 0 && (
( - ({ className, size = 30, src, placeholder, badgeSrc, ...props }, ref) => { + ( + { + className, + sClassName, + iClassName, + size = 30, + src, + placeholder, + badgeSrc, + ...props + }, + ref, + ) => { return (
( {...props} > ( alt={placeholder} />