If you don’t have a Next.js project set up yet, you can create one using the following commands:
Tailwind CSS is required to style our components. To install Tailwind CSS, follow these steps:
a. Install Tailwind CSS and its dependencies:
Generate the tailwind.config.js and postcss.config.js files using:
In your tailwind.config.js file, update the content array to include paths to all your template files:
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
'./node_modules/@your-namespace/your-ui-library/**/*.{js,ts,jsx,tsx}',
],
theme: {
extend: {},
},
plugins: [],
}
In your styles/globals.css file, add the following Tailwind directives to import Tailwind’s base styles:
Now you’re all set to start using our UI components! Here’s a basic example of how to use one of our components in a Next.js page:
export default function Home() {
return (
<div className="flex items-center justify-center h-screen bg-gray-100">
<Button>Click Me</Button>
</div>
);
}
For more information on using our components and customizing them, refer to the Your UI Component Library Documentation. If you encounter any issues or have questions, don’t hesitate to reach out to our support team or open an issue on our GitHub repository.