[FREE] VueJS + TailwindCSS NUI Boilerplate (Router, Pinia, Hot Reloading included!)

Download on GitHub for Free

A fully-featured NUI boilerplate using Vue 3 (with Vue Router and Pinia included!) and TailwindCSS. Includes NUI focus examples, escape key handling, and bi-directional communication out-of-the-box. Plus, pseudo hot-reloading as part of the build system!

I noticed most of the NUI boilerplates floating around are either outdated or don’t really contain good examples of how to handle common scenarios, so I’m open-sourcing the boilerplate I use for my projects. This is as feature-complete as possible, with many common use cases pre-configured or with useful examples to kickstart your project.

What’s included?

  • Vue 3 (configured for Composition API.)
  • Vue Router (plus two example pages.)
  • Pinia (plus two example stores.)
  • TailwindCSS (plus inline and SFC examples.)
  • Axios, Mix, RCON, and Dotenv.

Features

  • Vue Router + Pinia Examples: Includes two example pages handled using Vue Router and router links, as well as two Pinia stores with an example “increment counter” feature.

  • Open/Close Functionality: Includes an example of opening/closing the NUI screen using Lua. Also includes Escape Key support for closing the open NUI screen and releasing focus.

  • SendNUIMessage Example: Includes an example of how to handle messages sent to NUI using SendNUIMessage and updating a Pinia store accordingly.

  • NUI Callback Example: Includes an example of sending NUI callbacks from Vue or through a Pinia store action.

  • Hot Reloading: Using the Mix/Webpack build system and RCON, this boilerplate can automatically restart your resource whenever you save a file while running npm run watch.

Screenshots

Of course, the meat of this release is the code - but here’s what the example project looks like.

Console

Download

The best way to download this boilerplate is via Github, so you receive the latest updates!

Other releases

14 Likes

Great idea! Thanks for sharing.

2 Likes

nice work man

1 Like

How do I add an image to this? So that the webpack builds it correctly into /dist?