This guide will help you setup Tairo in your Nuxt project.
This command will create a new Nuxt project with minimal configuration and dependencies.
pnpm create nuxt <app>
This will create <app>
folder in your current directory containing an empty Nuxt project.
You can now navigate to the newly created project folder and install dependencies:
cd <app>
pnpm add --save-dev @shuriken-ui/nuxt tailwindcss
This optionnal step allows you to use the latest version of Nuxt with Tairo.
export default defineNuxtConfig({
future: {
compatibilityVersion: 4,
},
})
Useful resources:
Create the main.css
file where you will import Tailwind CSS and Shuriken UI styles.
export default defineNuxtConfig({
css: [
'~/assets/main.css',
],
})
@import 'tailwindcss';
@import '@shuriken-ui/nuxt';
@import '#layers/@cssninja/tairo/theme.css';
@theme {
/* Your custom theme */
}
Useful resources:
In order to make use of the Tairo components, you need to extends from Tairo layer. As tairo is a private repository, npm package is not available.
This is the simpliest way to use Tairo, but you will not be able to update it easily.
layers/tairo
folder to your project, keeping the same structure. You don't need to add it to nuxt.config.ts
file, as Nuxt will automatically load it.That's it! You can now install the dependencies and run the development server.
This step requires you to have unlocked your github access and have a github personal access token with the repo
scope for classic token, or read access to the Tairo repository for fine-grained access token.
The token is only need when installing. It is also needed on CI/CD environments.
GIGET_AUTH=ghp_your_github_token
nuxt.config.ts
file.2.0.0
is the latest stable version of Tairo, you can also use the edge
version which contains the current development version (useful for testing new features).export default defineNuxtConfig({
extends: [
'gh:cssninjaStudio/tairo/layers/tairo#2.0.0',
],
})
If you forgot to set the GIGET_AUTH
environment variable, if your token does not allow access to Tairo repository, or if you set a non existing version, you will see an error message like this:
ERROR Failed to download https://api.github.com/repos/cssninjaStudio/tairo/tarball/2.0.0: 404 Not Found
Useful resources:
Additionnal dependencies are required to use Tairo with Nuxt, add them to your project.
pnpm add --save-dev @shuriken-ui/nuxt tailwindcss
Start nuxt from the current folder and open the frontend in your browser.
pnpm dev
Once you are done, you can stop the de"solar:shield-warning-bold-duotonevelopment server by pressing Ctrl+C
(or ⌘+C
on macOS) in your terminal.