<UrUserButton> component renders a small profile avatar that, when clicked, opens a dropdown menu containing the user’s name, email, and action buttons like “Profile”, “Settings”, and “Logout”.
It automatically disappears if the user is not logged in, making it safe to place anywhere in your application layout.
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
shape | 'square' | 'circle' | 'square' | The visual shape of the avatar button. |
position | 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'inline' | 'top-right' | Positions the button fixed to the screen corners, or 'inline' to fit into standard flex/grid layouts. |
onProfileClick | () => void | undefined | Callback fired when the “Profile” button in the dropdown is clicked. If undefined, the button is hidden. |
onSettingsClick | () => void | undefined | Callback fired when the “Settings” button in the dropdown is clicked. If undefined, the button is hidden. |
zIndex | number | 999 | The z-index of the fixed container. |
