Intallation
How to install dependencies and structure your app.
Frameworks
Current UI is current built to be used in Next.JS / React projects
This installation process will be focused on setting up or app the necessary dependencies / files to your project.
Create your NEXT.JS project
Start by creating a new Next.js project using create-next-app:
Typescript
The Current UI components are written in TypeScript. Using TypeScript offers several benefits, including improved code maintainability, reduced errors, and better IDE support for autocompletion and type checking. This is the optimal approach for utilizing our components. However, we are exploring the possibility of extending support for JavaScript components in the future.
Typescript DocumentationTailwind
The current UI uses Tailwind CSS for component styling. However, we are exploring the possibility of adding support for CSS and SASS in the future to expand styling preferences.
Tawilwind DocumentationGlobal CSS
Current UI uses CSS variables to maintain a centralized design system, making it easy to implement future changes.
Learn more about our themingCopy and paste the following code into your global.css
file.
Tailwind Config
Now that we have added all our CSS variables to our global.css
file we need to update our
Tailwind configuration.
Copy and paste the following code into your tailwind.config.js
file.
Classname Helper Function Dependencies
Most of our components rely on a cn
helper function to merge classnames. This allows us to merge styles
directly onto the base component with added styles elsewhere where we
use that component.
Intall the following dependencies:
Class Variance Authority'
Class Variance Authority, or cva
, is
used to easily manage different component style variants. We use the cva
function to add multiple style
variants to the base component. This allows you to easily apply
different styles in multiple locations, resulting in improved
efficiency and cohesiveness.
When using cva
with Tailwind CSS, here
are some additional (optional) steps to get the most out of cva
: You can enable autocompletion
inside cva
.
Tailwind Merge
Tailwind Merge is a utility function to efficiently merge Tailwind CSS classes in JS without style conflicts.
Tailwind MergeClassname Helper Function
Now that we have all the necessary dependencies installed, we can set
up our cn
helper function.
Inside your lib
folder, paste the follwing code into your utils.ts
file.
Lucid Icons
Some of the components use Lucid Icons. However, as it is your code, you can easily use any icon library you prefer. If you would like to use Lucid's icons for an out-of-the-box experience, install the following dependency;
Optional Installs
Automatic Class Sorting with Prettier
A Prettier plugin for Tailwind CSS that automatically sorts classes based on the recommended class order.
Prettier Tailwind Plugin Documentation