JGuang / JGuang UI

Manual Installation

Add dependencies to your project manually.

Partially translated: Chinese navigation, titles, descriptions, and common headings. The technical body is currently in English.

Add Tailwind CSS

Components are styled using Tailwind CSS. You need to install Tailwind CSS in your project.

Follow the Tailwind CSS installation instructions to get started.

Add dependencies

Add the following dependencies to your project:

Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.

Configure import aliases

Choose one of the following alias setups.

Option A: tsconfig.json paths

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["./*"]
    }
  }
}

Option B: package.json#imports

{
  "imports": {
    "#components/*": "./src/components/*.tsx",
    "#lib/*": "./src/lib/*.ts",
    "#hooks/*": "./src/hooks/*.ts"
  }
}
{
  "compilerOptions": {
    "moduleResolution": "bundler",
    "resolvePackageJsonImports": true
  }
}

The @ alias is a preference. You can use other aliases if you want. If you use package.json#imports, keep the matching alias roots in components.json. See the

package imports guide

for framework-specific setup.

Configure styles

Add the following to your styles/globals.css file. You can learn more about using CSS variables for theming in the theming section.

Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.

Add a cn helper

import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"

export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs))
}

Create a components.json file

Create a components.json file in the root of your project.

Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.

If you're using package.json#imports, use the corresponding #... aliases instead:

{
  "aliases": {
    "components": "#components",
    "utils": "#lib/utils",
    "ui": "#components/ui",
    "lib": "#lib",
    "hooks": "#hooks"
  }
}

That's it

You can now start adding components to your project.

Source: installation/manual.mdx

Technical documentation for JGuang UI.

On this page