Nuxt UI thrives thanks to its incredible community ❤️. We welcome all contributions through bug reports, pull requests, and feedback to help make this library even better.
Here's an overview of the key directories and files in the Nuxt UI project structure:
The documentation lives in the docs folder as a Nuxt app using @nuxt/content to generate pages from Markdown files. See the Nuxt Content documentation for details on how it works. Here's a breakdown of its structure:
├── app/
│ ├── assets/
│ ├── components/
│ │ └── content/
│ │ └── examples # Components used in documentation as examples
│ ├── composables/
│ └── ...
├── content/
│ ├── 1.getting-started
│ ├── 2.composables
│ └── 3.components # Components documentation
The module code resides in the src folder. Here's a breakdown of its structure:
├── plugins/
├── runtime/
│ ├── components/ # Where all the components are located
│ │ ├── Accordion.vue
│ │ ├── Alert.vue
│ │ └── ...
│ ├── composables/
│ ├── locale/
│ ├── plugins/
│ ├── types/
│ ├── utils/
│ └── vue/
│ ├── components/
│ └── plugins/
├── theme/ # This where the theme for each component is located
│ ├── accordion.ts # Theme for Accordion component
│ ├── alert.ts
│ └── ...
└── module.ts
To make development easier, we've created a CLI that you can use to generate components and locales. You can access it using the nuxt-ui make command.
First, you need to link the CLI to your global environment:
npm link
You can create new components using the following command:
nuxt-ui make component <name> [options]
Available options:
--primitive Create a primitive component--prose Create a prose component--content Create a content component--template Only generate specific template (available templates: playground, docs, test, theme, component)Example:
# Create a basic component
nuxt-ui make component my-component
# Create a prose component
nuxt-ui make component heading --prose
# Create a content component
nuxt-ui make component block --content
# Generate only documentation template
nuxt-ui make component my-component --template=docs
You can create new locales using the following command:
nuxt-ui make locale --code <code> --name <name>
Before you start, check if there's an existing issue describing the problem or feature request you're working on. If there is, please leave a comment on the issue to let us know you're working on it.
If there isn't, open a new issue to discuss the problem or feature.
To begin local development, follow these steps:
nuxt/ui repository to your local machinegit clone -b v4 https://github.com/nuxt/ui.git
corepack enable
pnpm install
pnpm run dev:prepare
docs folder, run:pnpm run docs
pnpm run dev
pnpm run dev:vue
We recommend using VSCode alongside the ESLint extension. You can enable auto-fix and formatting when saving your code. Here's how:
{
"editor.codeActionsOnSave": {
"source.fixAll": false,
"source.fixAll.eslint": true
}
}
You can use the lint command to check for linting errors:
pnpm run lint # check for linting errors
pnpm run lint:fix # fix linting errors
We use TypeScript for type checking. You can use the typecheck command to check for type errors:
pnpm run typecheck
Before submitting a PR, ensure that you run the tests for both nuxt and vue:
pnpm run test # for Nuxt
pnpm run test:vue # for Vue
u after the tests have finished running.We use Conventional Commits for commit messages, which allows a changelog to be auto-generated based on the commits. Please read the guide through if you aren't familiar with it already.
fix and feat for code changes that affect functionality or logicdocs for documentation changes and chore for maintenance tasksSquash and Merge when merging.lint, typecheck and tests work before submitting the PR. Avoid making unrelated changes.We'll review it promptly. If assigned to a maintainer, they'll review it carefully. Ignore the red text; it's for tracking purposes.
Thank you again for being interested in this project! You are awesome! ❤️