Getting Started
Dark Mode
Charts
Colors
Drag-and-drop
Forms
Utilities
Installation
Install the necessary packages and set up your project. This tool automates the process, streamlining your setup with no extra steps required.
Installation via CLI
Before executing the command, ensure that tailwind is installed. If not, follow the instructions here for installation.
Running this command will overwrite your main css file. It is recommended to use this in a new project rather than an existing one to avoid manual file additions.
This documentation is for the latest version of Justd which assumes you are using tailwind v4, if you're using v3, you can refer to the 1.x documentation.
Initial Setup
Begin by executing this command:
When you're run this command, it will ask a couple of questions. Like where's your components folder, utils, your main css file, and lastly is the theme you want like so:
If it's all good, you will see the following:
Add Components
Next, use add [component-name]
to include a specific component in your project. This allows for selective installation without the need for a full setup. If you need a file-trigger or even a button, this command facilitates that. Install only what you need, or refer to the documentation to manually include components. Here's how to add a combo-box
:
This command will ensure all necessary components are installed:
Sometimes, you may want to add components individually, such as select
and text-field
. You can easily do this by using the following command:
If you need to include grouped components, refer to the documentation which organizes related components under a single namespace, such as collections, overlays, and forms. This allows you to add them all at once, like so:
Using this command, you will install all components under the overlays namespace.
Override
You can override the existing components by using the -o
flag. This will overwrite the existing files with the new ones.
Select and Add Components
You might prefer to select the components you want to include by adding them without specifying any items. Just use the following command to add components:
This command will present a list of available components, which you can navigate and select using the arrow keys and spacebar.
Diff
You can see the differences between your current setup and the new one by using the following command:
You can see this tweet if you're not sure.
You can also doing a diff to specific components by using the following command:
Starter Kit
Explore our range of starter kits designed to suit various project needs. Whether you're working with Next.js, Laravel, Vite, or other frameworks, we've got you covered.
Got a starter kit for something else, like Remix or Astro? Consider submitting a PR to help expand our list!
Vite
For a simple and speedy setup with React Router 7 and Vite, try the Vite Starter Kit:
Laravel
Start your Laravel journey with our Laravel Starter Kit. Make sure you have Composer installed. Follow these steps:
Your Laravel project is now up and running!
Next.js
Elevate your projects with the Next.js Starter Kit. Fully loaded and ready to go:
Remix
Interested in Remix? Dive into the Remix Starter Kit, crafted by José Miguel. Here’s how to get started:
Tanstack Router
The starter kit for Tanstack Router is available here. Start with this command:
After cloning the repository, navigate to the tanstack-router-app
directory and run the following command to install the dependencies and start the development server:
Astro
Looking for a production-ready Astro setup? Check out our Astro Starter Kit. Start with this command:
For more details, visit the Astro repository.
Manual Installation
To begin setting up the design system, start by installing these packages:
Sometimes, using the CLI is the way to go, so make sure you install the necessary dependencies for the components you want to use.
Next, add Tailwind Variant, Tailwind Merge, and for utility functions:
Sometimes, using the CLI is the way to go, so make sure you install the necessary dependencies for the components you want to use.
Following that, include the animation package for managing animations and Paranoid for icons:
Sometimes, using the CLI is the way to go, so make sure you install the necessary dependencies for the components you want to use.
Style and Primitive
After installing the required packages, you can copy the CSS below into your global CSS file and move the primitives to your UI folder. Primitives serve as utilities for managing states, including focusRing
, focusStyles
, and focusButtonStyles
. Additionally, there’s a hook called useMediaQuery
and a function named composeTailwindRenderProps
. Every component in Justd relies on helpers from this file, so it’s essential to include it!
Classes and Hooks
All components that use the cn
function will import it from the utils/classes.ts
file, which provides a cn
function compatible with server components. Hooks are only used in specific components like the Navbar, Sidebar, Popover, and Command Menu. If you're using the Justd CLI, it will handle this automatically; otherwise, download the file below.
Simple Import
Indeed, it's efficient because the index.ts
file in your UI folder serves as a hub. Even if the button and badge components are in separate files, you can import them together easily. First, create a ui/index.ts
file:
So, here's the scoop: your UI folder contains an index.ts
file, right? This file consolidates all your components for straightforward access. Simply tell TypeScript where to find it and import them as needed, hassle-free!
If you're using a src
folder, you can use the following config:
Fonts
This is currently using the Inter font. If you want to use a different font, you can define your font-family in your JS or CSS file.
Stylesheet
When you're working with a stylesheet, you can define your @font-face
in your css file.
Next.js
If you're using Next.js, you don't event need css files. Just define your font in your layout file.
Then, apply the fontSans
to the body
tag like this:
Then, you can use the variable in your main css file like this:
For more information, refer to the Tailwind documentation and Next.js documentation.
InteliSense
If you want your development environment to be more intelligent, you can follow instructions here at Tailwind Variants.
Dark Mode
Justd supports dark mode out of the box. Every framework has its own way of implementing dark mode. So you better check the docs list below: