Templates
Learn how to generate a Pixi’VN project from a template, set it up in your IDE, run and customise it, and understand its project structure.
You can generate a new project from a template by running:
npm create pixi-vn@latestInteractive demo
How to use a template
If you are reading this page, you likely already have a project generated from a template. The following sections will guide you through the first steps to get it up and running.
Initial setup
Open the project folder with your IDE. The examples below use Visual Studio Code.
Once the project is open, VS Code will automatically suggest a few things:
- Install recommended extensions — a notification will appear asking you to install the workspace-recommended extensions. It is strongly advised to accept. If the notification does not appear, you can install them manually from the Extensions panel by filtering for recommended extensions.
- Run startup tasks — VS Code may prompt you to run the configured startup tasks, which will install all project dependencies. If you prefer to do it manually, run:
npm installMulti-platform
If you selected a template that targets desktop or mobile platforms, you will need to install the additional dependencies required by Tauri (Rust toolchain and platform-specific build tools). Because Tauri integrates deeply with the system environment, you will likely need to restart VS Code one or more times before the project can be launched as a desktop application.
The easiest way to install Rust on any platform is via rustup, the official Rust toolchain installer.
Download and run rustup-init.exe, or install it from the terminal with winget:
winget install --id Rustlang.RustupAfter installation, restart your terminal (and VS Code) so the cargo command is available on PATH.
Once installed, verify it with:
rustc --versionRun the project
The template includes a set of pre-configured launch configurations for VS Code. If you are not familiar with them: launch configurations are shortcuts that tell VS Code how to start your project (and optionally attach a debugger), so you do not need to type commands in the terminal every time. You can access them from the Run and Debug panel (the play-button icon in the left sidebar, or press F5). Select the configuration you want from the dropdown at the top of the panel and press the green play button.

The following configurations are available:
- Debug Game: this is the configuration you will use most often during development — every time you save a file, the browser refreshes automatically. Keep in mind that in this mode animations may not be perfectly smooth and asset loading can be slower than in the final published build.
- Debug Game Preview: which closely simulates how the game will behave once published: animations are fluid, loading times are realistic, and optimisations are active. Use this configuration when you want to verify that everything looks and feels correct before publishing.
- Run as Desktop App (Dev): it compiles the Rust/Tauri backend and launches the game as a native desktop window. If your template does not target desktop or mobile platforms, this configuration will not be present.
All commands must be run from the root of the project.
Development
| Command | Description |
|---|---|
npm run dev | Start the Vite development server and open the game in the browser. |
npm run tauri:dev | Start the game as a desktop application (requires the multi-platform template and Tauri installed). |
npm run tauri:android:dev | Start the game on a connected Android device or emulator. |
npm run tauri:ios:dev | Start the game on a connected iOS device or simulator. |
Build & Preview
| Command | Description |
|---|---|
npm run build:fast | Build the web app only (no Tauri). Fast, suitable for web publishing. |
npm run build | Full build: compiles TypeScript, builds the web app, and packages the Tauri desktop app. |
npm run preview | Run build:fast and then serve the result locally — simulates the published web game. |
Assets & icons
| Command | Description |
|---|---|
npm run icon | Generate all icon variants (PWA, desktop, mobile) from public/icon.png. Run this after replacing the icon. |
UI
| Command | Description |
|---|---|
npm run ui:reinit | Reinitialize shadcn/ui from scratch (force-reinstall all components) and reformat source files afterwards. |
Code quality
| Command | Description |
|---|---|
npm run lint | Check the code for errors using Biome. |
npm run check | Run all Biome checks (lint + format verification). |
npm run format | Automatically format all source files. |
Customise the style
The template UI is built entirely with shadcn/ui, which means you can customise the colour theme without touching any component code.
Open the shadcn/ui theme builder, adjust the colours to your taste, then navigate to the Copy section of the page to copy the generated CSS command. Run that command from the root of your project:
npx shadcn@latest add <paste-the-generated-command-here>Once applied, it is recommended to reformat the source files:
npm run formatFor further customisation — fonts, global styles, and more — see Styles & font.
Project structure
ink/— write your story in ink scripts here. The template includes a samplestart.inkto get you started.src/content/— auto-imported at startup; define all game elements here:ink/hashtag-commands.ts— custom hashtag commands from ink scripts. See ink hashtag commands.ink/text-replaces.ts— text replacements for ink dialogue. See ink text replacements.labels/— labels defining game flow and scenes (use the.label.tsnaming convention).characters.ts— character definitions.
src/assets/— source game assets (images, audio, fonts, etc.). Auto-analysed by Pixi Asset Pack.public/assets/— auto-generated optimized assets used by the project at runtime.public/icon.png— source icon. Replace it and runnpm run iconto regenerate all PWA/desktop/mobile variants.src/assets/index.ts— re-exports the auto-generated asset manifest for the engine.
src/components/— React UI components (screens, menus, dialogue boxes, etc.).src/routes/— TanStack Router route definitions. See Navigation.src/styles.css— global stylesheet (shadcn/ui). See Fonts & styles.
src/lib/i18n.ts— internationalisation setup. See Translations.src/locales/— one translation JSON per language (e.g.en.json). See Translations.
src/models/— custom classes and TypeScript types.src/main.tsx— application entry point; initialises Pixi’VN.src/pixi-vn.keys.gen.ts— auto-generated file with TypeScript types for all keys in the Pixi’VN API (e.g.PixivnCharacterIds,PixivnLabelIds, etc.). Used for type safety and autocompletion when working with the engine.src/pixi-vn.d.ts— TypeScript declaration overrides for@drincs/pixi-vn.
src-tauri/— Rust/Tauri source (multi-platform templates only); enables native desktop and mobile builds.
src/lib/— utilities and internals:steam.ts— Steam API (achievements, cloud saves). See Steam distribution.
src/constants.ts— project-wide constants (screen sizes, config values, etc.).
Template screens
The template comes with a set of pre-built screens that cover the essential parts of a visual novel. Each screen is a React component connected to a route managed by TanStack Router.
- Main menu (
/) — the first screen the player sees when they launch the game. It provides the entry point to start a new game, continue a saved one, and open the settings. - Narration screen (
/game/narration) — the core gameplay screen where the story is displayed. It renders dialogue, character sprites, backgrounds, and choices. - Settings — the settings panel does not have its own dedicated route. Instead it uses Search Params to overlay itself on top of whatever screen is currently active. This approach keeps the URL clean while still allowing the player to open settings from anywhere in the game, and to navigate between settings sections (audio, display, language, etc.) without losing track of where they were.
- Navigation screen (
/game/navigation) — Point & Click only. It lets the player navigate between rooms and perform the various actions available in the current location. - Map screen (
/game/map) — Point & Click only. It shows the map and lets the player move from one location to another. It also supports managing multiple maps.