Create Avatar component

This commit is contained in:
Mathias Wagner
2025-09-09 13:43:07 +02:00
parent 29b32ec317
commit a5f3ed1634
3 changed files with 59 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import React from 'react';
import './styles.sass';
export const Avatar = ({
children,
size = 'md',
variant = 'default',
className = '',
...rest
}) => {
const avatarClasses = [
'avatar',
`avatar--${size}`,
`avatar--${variant}`,
className
].filter(Boolean).join(' ');
return (
<div className={avatarClasses} {...rest}>
{children}
</div>
);
};

View File

@@ -0,0 +1 @@
export { Avatar as default } from './Avatar.jsx';

View File

@@ -0,0 +1,35 @@
.avatar
background: var(--bg-elev)
border: 1px solid var(--border)
border-radius: 50%
display: flex
align-items: center
justify-content: center
color: var(--text-dim)
flex-shrink: 0
&--sm
width: 32px
height: 32px
&--md
width: 48px
height: 48px
&--lg
width: 64px
height: 64px
&--xl
width: 80px
height: 80px
&--primary
background: var(--accent)
color: white
border-color: var(--accent)
&--success
background: #16a34a
color: white
border-color: #16a34a