hanbiro-react18-sdk
v1.0.3
Published
Shared React components and utilities for Hanbiro
Readme
hanbiro-react18-sdk
A comprehensive collection of shared React components and utilities for Hanbiro applications, built with React, Material UI, and Vite.
🚀 Installation
Install the package via npm or yarn:
npm install hanbiro-react18-sdk
# or
yarn add hanbiro-react18-sdk📦 Usage
Initialization & Setup
[!IMPORTANT] You must call
initHanbiroReactSDKbefore rendering your application to configure the SDK with your server's base URL. Wrap your root component with<ThemeCustomization>for correct styling.
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import { ThemeCustomization } from "hanbiro-react18-sdk/components";
import { initHanbiroReactSDK } from "hanbiro-react18-sdk/utils";
// 1. Initialize the SDK with your base URL
initHanbiroReactSDK({ baseUrl: "https://your-server.com/ngw" });
// 2. Render the application
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<ThemeCustomization>
<App />
</ThemeCustomization>
</React.StrictMode>,
);Importing Components
import { SplitView, NumberInput } from "hanbiro-react18-sdk/components";Importing Utilities
import { getBaseUrl, getGroupwareUrl, isDevelopment } from "hanbiro-react18-sdk/utils";
console.log("API Base URL:", getBaseUrl());
console.log("Groupware URL:", getGroupwareUrl());🛠 Features
Utilities (hanbiro-react18-sdk/utils)
| Export | Description |
| --------------------- | -------------------------------------------------------- |
| initHanbiroReactSDK | Initializes the SDK with your server's baseUrl |
| isDevelopment | Function returning true if running in dev environment |
| getBaseUrl | Returns the base server URL based on current environment |
| getGroupwareUrl | Returns the full Groupware URL for the current host |
Components (hanbiro-react18-sdk/components)
| Component | Description |
| --------------------------- | ---------------------------------------------- |
| CircularProgressWithLabel | Progress indicator with percentage label |
| Counter | Simple numeric counter component |
| FullscreenBtn | Button component to toggle fullscreen mode |
| LoadingContainer | Full-container loading state |
| NumberInput | Numeric input with increment/decrement buttons |
| OutlinedSelect | Select input component with an outlined style |
| SelectBox | Custom dropdown selection component |
| SplitView | Resizable split-pane layout |
| SwiperModal | Modal component with swipe support |
| ThemeCustomization | Global theme provider for Hanbiro styling |
| ToolltipOverflowText | Text component with tooltip on overflow |
📋 Requirements
- React:
>=18.0.0 - React DOM:
>=18.0.0 - Material UI:
^5.0.0 - Emotion:
^11.0.0
📄 License
MIT © Hanbiro Inc.
