A smooth, modern React component library built for Next.js.
npm install react-smooth-inputTo ensure styles are applied correctly, add the library to your tailwind.config.js or tailwind.config.ts:
// tailwind.config.ts
export default {
content: [
"./src/**/*.{js,ts,jsx,tsx,mdx}",
// Add this line so Tailwind scans the library files
"./node_modules/react-smooth-input/dist/**/*.{js,mjs}",
],
// ...
};import { Input } from "react-smooth-input";
export default function Page() {
return (
<div className="p-4 flex flex-col gap-4">
<Input label="Username" placeholder="Enter your username" />
</div>
);
}-
Install dependencies:
npm install
-
Start build in watch mode:
npm run dev
-
Build for production:
npm run build
To see your changes live, I've included a Next.js web app in the web folder.
-
Terminal 1: Start the library builder in watch mode:
npm run dev
-
Terminal 2: Start the web app:
cd web npm install npm run dev -
Open http://localhost:3000 to see your components in action. Any changes you make to
src/will rebuild and update the web app.
- React 18
- TypeScript
- tsup for bundling
- Next.js compatible ('use client' directives included)