Justd Blocks Docs: Installation
A detailed guide to help you set up Justd Blocks, seamlessly integrate it into your workflow, and start building effortlessly.
Introduction
Justd Blocks is a powerful toolkit designed to simplify the development of responsive, accessible, and visually stunning web applications. It offers a comprehensive collection of components, utilities, and tools, empowering developers to create high-quality, user-focused interfaces with ease. At its core, Justd Blocks leverages React Aria Components for its primitives and Tailwind CSS for styling.
Get started with Justd Blocks effortlessly. This guide assumes familiarity with a basic understanding of React.
CLI
If you're interested in setting up Justd Blocks quickly and easily, check out the CLI documentation.
Choose Your Framework
Justd Blocks integrates seamlessly into any React project, regardless of the framework you’re using.
Manual Setup
If you prefer not to use the CLI or haven’t found the right framework for your project, you can set up Justd Blocks manually.
CSS
Justd Blocks relies on Tailwind CSS for styling. To customize the look and feel of the components, you’ll need to include specific variables.
And that’s it! Once configured, Justd Blocks takes care of everything else for you.
Font
If you have a font installed locally, such as Inter, you can use the following CSS to apply your local font:
Ensure that the src: url('Inter.woff2')
in your CSS points to the correct directory where your font file is located. For example, if the font is in a folder named fonts
, reference it like this: src: url('fonts/Inter.woff2')
.
Next.js includes a default font called Geist. You can configure it in your layout like this:
Now, open your app/globals.css
file and add the following:
The Recommended font can be found here.
Classes
You may notice the use of the cn
function in some blocks or components. This function is designed to combine and merge Tailwind CSS classes seamlessly.
Simple Import / Aliases
In this setup, all components are imported from the ui
folder. This is possible because of the index.ts
file within the ui
folder, which consolidates all exports from that folder.
To enable this functionality, you need to add the appropriate path to the tsconfig.json
file. But it depends on your directory structure. This example is if you're using Laravel:
If you're using Next.js, the components are typically located in either the src/components
or app/components
directory. Depending on your project's structure, you might need to adjust the path to match your setup.
Additionally, if you're using Vite, you must also configure the path in the vite.config.js
file: