Packages
3 core packages for client-side development
A library providing useful React components and custom hooks.
A library providing useful utility functions for client-side development.
Quick Start
Get started in 3 simple steps
Install
Install the package you need
yarn add @modern-kit/react
yarn add @modern-kit/utils
yarn add -D @modern-kit/typesnpm install @modern-kit/react
npm install @modern-kit/utils
npm install -D @modern-kit/typespnpm add @modern-kit/react
pnpm add @modern-kit/utils
pnpm add -D @modern-kit/typesImport
Import the functions or hooks you need
import { useToggle } from '@modern-kit/react';
import { debounce } from '@modern-kit/utils';
📂 SubPath Import is also supported
import { useToggle } from '@modern-kit/react/useToggle';
import { debounce } from '@modern-kit/utils/common/debounce';Use
Use it right away with a simple API
function App() {
const [isOpen, toggle] = useToggle();
const handleSearch = debounce((value) => {
console.log('Search:', value);
}, 300);
return <div>...</div>;
}SubPath Imports
Reduce unused code and import only what you need to minimize bundle size
// Import from the full package
import { useToggle, useDebounce } from '@modern-kit/react';
import { debounce, throttle } from '@modern-kit/utils';// Import only the modules you need
import { useToggle } from '@modern-kit/react/hooks/useToggle';
import { debounce } from '@modern-kit/utils/common/debounce';Improved Dev Server Performance
By importing only the modules you need, unnecessary code is avoided and the bundler's module identification process is optimized.
Effective Tree-shaking
The bundler can better identify individual modules, making tree-shaking more effective and helping reduce the final bundle size.
Version Compatibility
Select only the modules you need without version constraints — for example, use features in a React v17 environment without importing v18-specific hooks.