react-smooth-input
v0.1.2
Published
A smooth input component library for Next.js
Maintainers
Readme
react-smooth-input
A smooth, modern React component library built for Next.js.
Installation
npm install react-smooth-inputSetup (Tailwind CSS)
To 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}",
],
// ...
};Usage
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>
);
}Development
Install dependencies:
npm installStart build in watch mode:
npm run devBuild for production:
npm run build
Live Development (Playground)
To see your changes live, I've included a Next.js example app in the example folder.
Terminal 1: Start the library builder in watch mode:
npm run devTerminal 2: Start the example app:
cd example npm install npm run devOpen http://localhost:3000 to see your components in action. Any changes you make to
src/will rebuild and update the example app.
Stack
- React 18
- TypeScript
- tsup for bundling
- Next.js compatible ('use client' directives included)
