# User Management

The User Management suite provides a collection of pre-built React components designed to handle essential user-related functionalities. These components simplify the implementation of user profiles, session management, and organization switching within your application, ensuring a consistent and reliable user experience.

This section provides an overview of the main components available in the suite. The following diagram illustrates how a user interacts with the different components of the application:

<!-- DIAGRAM_IMAGE_START:architecture:16:9:1765962229 -->
![User Management](assets/diagram/user-management-diagram-0.jpg)
<!-- DIAGRAM_IMAGE_END -->

For detailed implementation guides and API references, please refer to the specific component documentation linked below.

## Core Components

The suite is composed of several key components, each addressing a specific aspect of user management.

<x-cards>
  <x-card data-title="UserCenter" data-icon="lucide:user-cog" data-href="/components/user-management/user-center">
    A comprehensive component for displaying and managing user profiles. It includes features for handling user settings, passport management, and social interactions like following other users.
  </x-card>
  <x-card data-title="UserSessions" data-icon="lucide:smartphone-nfc" data-href="/components/user-management/user-sessions">
    A security-focused component that allows users to view and manage their active and past login sessions across different devices, enhancing account security.
  </x-card>
</x-cards>

### Organization Switching

The `OrgsSwitch` component provides a dropdown menu interface for users who belong to multiple organizations. It allows for seamless context switching, which is critical for applications with team-based or multi-tenant features.

**Key Features:**

*   **Current Organization Display:** Clearly shows the user's current organizational context.
*   **Organization List:** Lists all available organizations a user can switch to, complete with infinite scrolling for performance.
*   **Search Functionality:** Includes a search bar to quickly filter and find a specific organization.
*   **Creation and Navigation:** Provides options to create a new organization and a link to a dedicated page for managing all organizations.

### Hooks for User Interaction

To facilitate the development of social features, the library also includes custom hooks and contexts that abstract away complex logic.

*   **`useFollow` hook**: This hook manages the complete logic for following and unfollowing other users. It handles the API requests and state changes, returning the current follow status (`followed`) and functions to `followUser` and `unfollowUser`.
*   **`UserFollowersProvider` context**: For applications where follow status needs to be accessible across multiple components, this provider wraps a section of your component tree and makes the follow state and actions available via the `useUserFollowersContext` hook.

## Summary

This suite of components provides the necessary building blocks for robust user management in any application built with the library. By using these components, you can accelerate development and ensure your application follows best practices for user account management and security.

For detailed implementation guides, please proceed to the specific component documentation.

*   **Next:** [UserCenter](./components-user-management-user-center.md)
*   **See Also:** [UserSessions](./components-user-management-user-sessions.md)