# User

The `User` component displays the current user's name and avatar. If the user belongs to more than one account, they can switch accounts here. It also provides options to change the language, toggle dark mode, and sign out.

It's rendered within the header component and appears at the top right-hand corner of the viewport.&#x20;

### Preview

<div align="left"><figure><img src="/files/P0vvKZtzbCyaiwQwrGwd" alt="Gravity user component" width="334"><figcaption></figcaption></figure></div>

### Usage

```javascript
import { User } from 'components/lib';

function MyComponent({ ...props }) {
  return (
    <div>
      <User />
    </div>
  );
}
```

### Props

This component does not accept any props directly as it uses context for its functionality.

### User Avatars

Users can upload an avatar in the `/account/profile` view, and it will be [uploaded to your S3 bucket](/gravity-server/file-uploads.md) in a folder called `avatars` and displayed in the `User` component.&#x20;

You can change the folder and size of the photos inside the [config](/gravity-server/config.md) file in the `avatar` section.

Users signed in via a social network will display the profile picture from that network unless they overwrite it by uploading a photo.&#x20;

### Notes

* The `User` component relies on `AuthContext` and `ViewContext` for authentication and view management.
* The `DropdownMenu` component is used to display the user options.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.usegravity.app/gravity-web/components/user.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
