a Nuxt 3 starter template or boilerplate with a lot of useful features. and integrated with TailwindCSS 3.
WARNING
Nuxt 3 now in RC version (Release Candidate)
Nuxt 3 is still in beta and is not recommended for production use.
- 💨 Tailwind CSS v3 with Windicss
- ✨ Headless UI
- 🔔 Icon Pack Component (unplugin-icons)
- 🛹 State & Store Management (Pinia)
- 🚩 Localization (i18n) by @intlify
- 📦 Vue Composition Collection (Vueuse)
- 🌙 Switch Theme (light, dark, system, realtime)
- 🇮🇩 Language Switcher
- 🪝 Built-in Component & Layout
- Eslint & Prettier
- Husky & Commitlint
- Http Request (axios ?)
- Footer
- Button
- Anchor (link)
- Navbar
- Navbar Builder
- Drawer (on mobile)
- Options (on mobile)
- Action Sheet
- Theme Toggle / Switcher
- Page Layout
- Wrapper
- Header
- Title
- Body
- Section
- Section Wrapper
- Section Title
- Section
- Dashboard Layout
- Sidebar
- Modal
- Alert
- This project using
yarn
as package manager. - Clone this project to your computer
git clone https://github.com/viandwi24/nuxt3-awesome-starter
- Install dependencies
yarn install
- Run
yarn dev
to start development server and openhttp://localhost:3000
in your browser - Run
yarn build
to build project andyarn start
to start production server
Checkout the deployment documentation.
Tailwindcss import managed by windicss. and you can add custom styles in :
/path/to/assets/sass/app.scss
ThemeManager is a plugin that allows you to switch between themes. this lib in :
/path/to/utils/theme.ts
Thememanager
is a function-class construct when app.vue before mounted. theme construct inside AppSetup()
in /path/to/app.vue
:
<!-- /path/to/app.vue -->
<script lang="ts" setup>
import { AppSetup } from '~/utils/app';
// app setup
AppSetup()
</script>
To change theme, you can direct set theme from state theme.setting
, example :
<script lang="ts" setup>
import { IThemeSettingOptions } from '~/utils/theme'
const themeSetting = useState<IThemeSettingOptions>('theme.setting')
themeSetting.value = 'dark'
</script>
When you change state theme.setting
, it will automatically change theme.
Theme Setting have 4 options :
light
dark
system
(operating system theme)realtime
(realtime theme, if 05:00 - 17:00, it will change to light theme, otherwise dark)
We have state theme.current
, this state return light
or dark
theme. basically it's process from theme.setting
.
dont change theme with this state.
Localization is a plugin that allows you to switch between languages. this lib in :
/path/to/utils/lang.ts
LanguageManager
is a function-class construct when app.vue before mounted.
this lib depend on @intlify/nuxt3
lang construct inside AppSetup()
in /path/to/app.vue
:
To change language, you can direct set language from state lang.setting
, example :
<script lang="ts" setup>
const langSetting = useState<string>('locale.setting')
langSetting.value = 'en'
</script>
When you change state locale.setting
, it will automatically change language.
This project using unplugin-icons for auto generate and import icon as component.
You can see collection icon list in : https://icones.js.org/
you can use <prefix-collection:icon />
or <PrefixCollection:Icon />
.
in this project, configuration prefix as a "icon", you can see in nuxt.config.ts
:
export default defineNuxtConfig({
...
vite: {
plugins: [
UnpluginComponentsVite({
dts: true,
resolvers: [
IconsResolver({
prefix: 'Icon',
}),
],
}),
],
},
...
})
Example :
// use icon from collection "Simple Icons" and name icon is "nuxtdotjs"
<IconSimpleIcons:nuxtdotjs />
// use icon from collection "Unicons" and name icon is "sun"
<IconUil:sun />
This project using husky and commitlint for precommit and postmerge.
when you commit, it will check your commit message and running "yarn lint-staged" to check your staged files.
configuration in : /path/to/.husky/pre-commit
and /path/to/commitlint.config.js
And when Postmerge, it will run "yarn" to automatically install new dependencies.
configuration in /path/to/.husky/post-merge
This project is licensed under the MIT license, Copyright (c) 2022 Alfian Dwi Nugraha. For more information see the LICENSE file.