❤️ Support our project - Your donation helps us continue developing awesome tools!


Docs
Remix

Remix

Install and configure Remix.

Create project

Start by creating a new Remix project using create-remix:

npx create-remix@latest my-app

Run the CLI

Run the nyxb init command to setup your project:

npx nyxb@latest init

Configure nyxbui.json

You will be asked a few questions to configure nyxbui.json:

Which style would you like to use? › Miami
Which color would you like to use as base color? › Zinc
Do you want to use CSS variables for colors? › no / yes

App structure

  • Place the UI components in the app/components/ui folder.
  • Your own components can be placed in the app/components folder.
  • The app/lib folder contains all the utility functions. We have a utils.ts where we define the ny helper.
  • The app/tailwind.css file contains the global CSS.

Install Tailwind CSS

npm add -D tailwindcss@latest autoprefixer@latest

Then we create a postcss.config.js file:

export default {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  },
}

And finally we add the following to our remix.config.js file:

/** @type {import('@remix-run/dev').AppConfig} */
export default {
  ...
  tailwind: true,
  postcss: true,
  ...
};

Add tailwind.css to your app

In your app/root.tsx file, import the tailwind.css file:

import styles from "./tailwind.css?url"
 
export const links: LinksFunction = () => [
  { rel: "stylesheet", href: styles },
  ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
]

That's it

You can now start adding components to your project.

npx nyxb@latest add button

The command above will add the Button component to your project. You can then import it like this:

import { Button } from "~/components/ui/button"
 
export default function Home() {
  return (
    <div>
      <Button>Click me</Button>
    </div>
  )
}