
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
rte-utils
Advanced tools
React components library in TypeScript for agigox projects.
npm install rte-utils
You need to import both the component and its CSS styles:
import { Histogram, Chip } from 'rte-utils';
import 'rte-utils/dist/index.css'; // Import the CSS styles
import React from 'react';
import { Histogram } from 'rte-utils';
import 'rte-utils/dist/index.css';
function App() {
return (
<div>
<Histogram
max={{ value: 100, color: '#D3D64E' }}
relative={{ value: 56, color: '#C0C402' }}
barWidth={32}
>
<div className="histogram-value-container">
<p className="histogram-value">56</p>
<p className="histogram-unit">MWh</p>
</div>
<div>
<p className="histogram-label">Soutirage</p>
</div>
</Histogram>
</div>
);
}
export default App;
import React, { useState } from 'react';
import { Histogram } from 'rte-utils';
import 'rte-utils/dist/index.css';
function EnergyDashboard() {
const [currentValue, setCurrentValue] = useState(45);
return (
<div style={{ display: 'flex', gap: '1rem' }}>
<Histogram
max={{ value: 100, color: '#D3D64E' }}
relative={{ value: currentValue, color: '#C0C402' }}
barHeight={120}
barWidth={40}
>
<div className="histogram-value-container">
<p className="histogram-value">{currentValue}</p>
<p className="histogram-unit">MWh</p>
</div>
<div>
<p className="histogram-label">Consommation</p>
</div>
</Histogram>
<button onClick={() => setCurrentValue((prev) => prev + 10)}>Increase (+10)</button>
</div>
);
}
import React from 'react';
import { Histogram } from 'rte-utils';
import 'rte-utils/dist/index.css';
function HorizontalChart() {
return (
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}>
<Histogram
max={{ value: 100, color: '#D3D64E' }}
relative={{ value: 75, color: '#C0C402' }}
barWidth={200} // This becomes height in horizontal mode
barHeight={24} // This becomes width in horizontal mode
orientation="horizontal"
>
<div className="histogram-value-container">
<p className="histogram-value">75</p>
<p className="histogram-unit">%</p>
</div>
<div>
<p className="histogram-label">Progress</p>
</div>
</Histogram>
</div>
);
}
import React from 'react';
import { Histogram } from 'rte-utils';
import 'rte-utils/dist/index.css';
function CustomCornerChart() {
return (
<div style={{ display: 'flex', gap: '1rem' }}>
{/* Rounded top corners only */}
<Histogram
max={{ value: 100, color: '#E0E0E0' }}
relative={{ value: 60, color: '#4CAF50' }}
barWidth={32}
barHeight={120}
cornerRadius={{
topLeft: 16,
topRight: 16,
bottomLeft: 0,
bottomRight: 0,
}}
/>
{/* Fully rounded corners */}
<Histogram
max={{ value: 100, color: '#F0F0F0', opacity: 0.5 }}
relative={{ value: 80, color: '#2196F3' }}
barWidth={32}
barHeight={120}
cornerRadius={{
topLeft: 16,
topRight: 16,
bottomLeft: 16,
bottomRight: 16,
}}
/>
{/* Asymmetric corners */}
<Histogram
max={{ value: 100, color: '#FFECB3' }}
relative={{ value: 45, color: '#FF9800' }}
barWidth={32}
barHeight={120}
cornerRadius={{
topLeft: 20,
topRight: 4,
bottomLeft: 4,
bottomRight: 20,
}}
/>
</div>
);
}
import React from 'react';
import { Histogram } from 'rte-utils';
import 'rte-utils/dist/index.css';
function AdvancedStylingChart() {
return (
<Histogram
max={{ value: 100, color: '#000000', opacity: 0.1 }}
relative={{ value: 65, color: '#E91E63' }}
barWidth={40}
barHeight={150}
orientation="vertical"
cornerRadius={{ topLeft: 8, topRight: 8, bottomLeft: 4, bottomRight: 4 }}
>
<div className="histogram-value-container">
<p className="histogram-value">65</p>
<p className="histogram-unit">kW</p>
</div>
<div>
<p className="histogram-label">Power Usage</p>
</div>
</Histogram>
);
}
A histogram component with smooth animations for energy data visualization.
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
max | { value: number; color: string; opacity?: number } | ✅ | - | Maximum value configuration with value, color, and optional opacity |
relative | { value: number; color: string } | ✅ | - | Relative/current value configuration with value and color |
barHeight | number | ❌ | 103 | Height of the histogram bar in pixels |
barWidth | number | ❌ | 32 | Width of the histogram bar in pixels |
orientation | 'vertical' | 'horizontal' | ❌ | 'vertical' | Orientation of the histogram bars |
cornerRadius | { topLeft?: number; topRight?: number; bottomLeft?: number; bottomRight?: number } | ❌ | { topLeft: 2, topRight: 2, bottomLeft: 2, bottomRight: 2 } | Individual corner radius configuration |
children | React.ReactNode | ❌ | - | Child components (typically text content) |
max.color represents the maximum valuerelative.color represents the relative valueThe component uses external CSS classes for styling. Make sure to import the CSS file:
import 'rte-utils/dist/index.css';
Development & quality commands:
npm run build – build the library (Rollup)npm run dev – watch mode buildnpm run test – run testsnpm run lint – run ESLint (no fixes)npm run lint:fix – run ESLint with auto fixesnpm run format – apply Prettier formattingnpm run format:check – check formatting (CI)npm run typecheck – TypeScript diagnostics (no emit)npm run storybook – start Storybooknpm run build-storybook – build static StorybookPrettier is integrated with ESLint (plugin:prettier/recommended). Formatting issues will surface as ESLint errors.
You can override the default styles by targeting the CSS classes:
.histogram-container - Main container.histogram-container--horizontal - Horizontal layout modifier.histogram-content - Content wrapper.histogram-content--horizontal - Horizontal content modifier.histogram-bar - Bar container.histogram-svg - SVG element.histogram-text-container - Text content container.histogram-text-container--horizontal - Horizontal text layout modifier.histogram-value-container - Value display wrapper.histogram-value - Main value text.histogram-unit - Unit text.histogram-label - Label textA comprehensive production unit component that combines an image display, status chip, input field, and switch control. Perfect for energy management dashboards and industrial control interfaces.
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
onChangeInput | (value: number) => void | ❌ | - | Callback triggered when input value changes |
onChangeSwitch | (checked: boolean) => void | ❌ | - | Callback triggered when switch state changes |
defaultValue | number | ❌ | - | Initial value for the input field |
defaultChecked | boolean | ❌ | false | Initial state for the switch |
unitName | string | ❌ | "Production Unit" | Display name for the production unit |
energyCost | number | ❌ | 0 | Energy cost value displayed in the chip (MW) |
checkedImage | React.ReactNode | ❌ | - | Custom image/component displayed when switch is ON |
uncheckedImage | React.ReactNode | ❌ | - | Custom image/component displayed when switch is OFF |
import React from 'react';
import { ProductionUnit } from 'rte-utils';
import 'rte-utils/dist/index.css';
function ProductionUnitExample() {
const handleInputChange = (value: number) => {
console.log('Production value changed:', value);
};
const handleSwitchChange = (checked: boolean) => {
console.log('Production unit is now:', checked ? 'ON' : 'OFF');
};
return (
<div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap' }}>
{/* Basic usage */}
<ProductionUnit
unitName="Solar Panel"
energyCost={25}
defaultChecked={true}
defaultValue={100}
onChangeInput={handleInputChange}
onChangeSwitch={handleSwitchChange}
/>
{/* With custom images */}
<ProductionUnit
unitName="Wind Turbine"
energyCost={50}
defaultChecked={false}
defaultValue={75}
checkedImage={
<img src="https://placehold.co/60x60/4CAF50/FFFFFF/png?text=ON" alt="Wind Turbine On" />
}
uncheckedImage={
<img src="https://placehold.co/60x60/F44336/FFFFFF/png?text=OFF" alt="Wind Turbine Off" />
}
onChangeInput={handleInputChange}
onChangeSwitch={handleSwitchChange}
/>
{/* With icon components */}
<ProductionUnit
unitName="Nuclear Plant"
energyCost={1000}
defaultChecked={true}
checkedImage={
<div
style={{
width: 60,
height: 60,
borderRadius: '50%',
backgroundColor: '#4CAF50',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
color: 'white',
fontWeight: 'bold',
}}
>
⚡
</div>
}
uncheckedImage={
<div
style={{
width: 60,
height: 60,
borderRadius: '50%',
backgroundColor: '#F44336',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
color: 'white',
fontWeight: 'bold',
}}
>
⚠️
</div>
}
/>
</div>
);
}
The ProductionUnit component uses the following CSS classes:
.production-unit-container - Main container.image-preview-container - Image display wrapper.production-unit-switch - Switch component stylingA customizable chip component for displaying labels, tags, or status indicators.
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
label | string | ❌ | - | Text content to display inside the chip |
bgColor | string | ❌ | - | Background color of the chip (CSS color value) |
textColor | string | ❌ | - | Text color of the chip (CSS color value) |
import React from 'react';
import { Chip } from 'rte-utils';
import 'rte-utils/dist/index.css';
function ChipExample() {
return (
<div style={{ display: 'flex', gap: '0.5rem' }}>
{/* Default chip */}
<Chip label="Default" />
{/* Success status chip */}
<Chip label="Success" bgColor="#d4edda" textColor="#155724" />
{/* Warning status chip */}
<Chip label="Warning" bgColor="#fff3cd" textColor="#856404" />
{/* Error status chip */}
<Chip label="Error" bgColor="#f8d7da" textColor="#721c24" />
{/* Custom branded chip */}
<Chip label="Custom" bgColor="#007bff" textColor="#ffffff" />
</div>
);
}
The Chip component uses the following CSS classes:
.chip-container - Main chip container.chip-content - Content wrapper.chip-label - Label text stylingThis package includes a demo application that showcases all available components with interactive examples. The demo is located in the /demo folder and includes:
To run the demo application:
cd demo
npm install
npm run dev
MIT
FAQs
React components library in TypeScript for agigox projects
We found that rte-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.