Custom UI Library built with React, Storybook and TailwindCSS
-
Setup your React project with TaillwindCSS configured. Please refer to Tailwind CSS installation guide.*
-
Create
.nprmc
file in your project root directory, then add this line:
@hydego17:registry=https://npm.pkg.github.com
- Install this package to your projectt
pnpm install @hydego17/test-ui
- Add the following line to your
tailwind.config.js
content's array:
content: [
...
'./node_modules/@hydego17/test-ui/dist/**/*',
],
- Import your desired component
import { useState } from "react";
import { Select } from "@hydego17/test-ui";
const App = () => {
const [values, setValues] = useState([]);
const handleChange = (options) => {
// perform action here
setValues(options);
};
return (
<Select
multiple
withSearch
onChange={handleChange}
options={[
{
value: "1",
label: "options 1",
},
{
value: "2",
label: "options 2",
},
{
value: "3",
label: "options 3",
},
]}
/>
);
};
export default App;