ProfileBox
Expandable profile selector with avatar, name, URL, and dropdown list of social profile items. Supports controlled and uncontrolled modes.
When to use
check_circleWhen to use
- In sidebar headers for user profile
- When showing multiple linked profiles
- For expandable profile information
- In navigation areas
cancelWhen not to use
- For simple user avatars
- When you only need to show name (use simpler component)
- In tight spaces where dropdown wont fit
States
Default (Closed)
Hover (Closed)
Hover
Active (Closed)
Active
Usage
tsx
import { ProfileBox } from '@/components/ProfileBox';
<ProfileBox
name="Lukas Vilkus"
url="vilkus.com"
avatarType="logo"
profileItems={[
{ name: 'LinkedIn', url: 'linkedin.com/in/lukasvilkus', type: 'linkedin', href: '...' },
{ name: 'Medium', url: 'medium.com/@vilkus', type: 'medium', href: '...' },
]}
/>
// Controlled
const [isOpen, setIsOpen] = useState(false);
<ProfileBox
name="Lukas Vilkus"
url="vilkus.com"
isOpen={isOpen}
onToggle={setIsOpen}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
name* | string | — | User's display name |
url* | string | — | User's website or handle |
avatarType | 'logo' | 'linkedin' | 'medium' | 'emplifi' | 'chodilove' | 'logo' | Avatar icon type |
avatarIcon | ReactNode | — | Custom avatar icon |
profileItems | ProfileItem[] | [] | Social profile items to show when expanded |
isOpen | boolean | — | Controlled open state |
onToggle | (isOpen: boolean) => void | — | Callback when open state changes |
Accessibility
- Uses
aria-expandedto indicate open state - Uses
aria-haspopupto indicate dropdown - Keyboard accessible (Enter/Space to toggle)
- Focus management when opening/closing