> For the complete documentation index, see [llms.txt](https://docs.digit.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digit.org/sandbox/platform/architecture/sandbox-ui/low-level-design/shared-components.md).

# Shared Components

### Overview

The Shared Components library is a collection of reusable React components designed for use in the Sandbox Portal. These pre-built UI components aim to standardize and streamline the development of the user interface across various micro frontends within the Sandbox Portal.

<div align="left"><figure><img src="https://383170073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLTNzsJMDGVoewNjC1V95%2Fuploads%2FAoLsjjiXlb5UmhMpZq9O%2FUIComponents.png?alt=media&amp;token=637e43f5-ccd6-4e8d-8b3b-2989cb121564" alt=""><figcaption><p>Shared Components</p></figcaption></figure></div>

## **Key Components**

* **Components**
  * **Purpose:** Provide a set of reusable React components.
  * **Examples:** InfoCard, Stepper, Button, Timeline, InfoButton, etc.
* **Contexts**
  * **Purpose:** Manage shared state and provide context to the components.
  * **Examples:** Authentication context, navigation context, etc.
* **Higher Order Components (HOCs)**
  * **Purpose:** Enhance components with additional functionalities.
  * **Examples:** withAuth, withNavigator, etc.
* **Hooks**
  * **Purpose:** Provide custom React hooks for common functionalities.
  * **Examples:** useCustomAPIHook, useLastUpdatedField, useMDMSHook, etc.
* **Providers**
  * **Purpose:** Context providers that manage and supply context to the application.
* **Services**
  * **Purpose:** Utility functions for API calls, caching, and other service-related tasks.
  * **Examples:** genericService, mdmsCache, Request, etc.
* **State Management**
  * **Purpose:** Manage the application state using custom hooks and state configurations.
  * **Examples:** createState, useAuthState, useDrawerState, useLocaleState, useNavigatorState, useTenantState, useUserState, etc.
* **Base Components**
  * Base components were from the DIGIT-UI-COMPONENT library.

For more details about the components, [documentation](https://core.digit.org/guides/developer-guide/ui-developer-guide/digit-ui/ui-components-standardisation/digit-ui-core-react-components), library information, and storybook refer to the provided resources.

{% embed url="<https://www.npmjs.com/package/@egovernments/digit-ui-components?activeTab=readme>" %}
published library
{% endembed %}

{% embed url="<https://unified-dev.digit.org/storybook>" %}
Storybook
{% endembed %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.digit.org/sandbox/platform/architecture/sandbox-ui/low-level-design/shared-components.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
