React library for building web-based visual novels

Overview

react-visual-novel

Latest release License

Build visual novels using web technologies. Powered by React, Tailwind CSS, Framer Motion, and howler.js.

Installation

This package requires some peer dependencies, which you need to install by yourself.

npm install react-visual-novel howler use-query-params

Quickstart

This is only a very basic usage example of react-visual-novel. To see everything that is possible with the library, please refer to a production demo.

import * as assets from 'assets'
import {bgSolidJpg} from 'assets'
import {Branch, Game, prepareBranches, Say, Scene} from 'react-visual-novel'
import 'react-visual-novel/dist/index.css'

function BranchIntro() {
  return (
    <Branch>
      <Scene src={bgSolidJpg.src} />
      <Say>Welcome to react-visual-novel!</Say>
    </Branch>
  )
}

const branches = prepareBranches({BranchIntro})

type MyBranches = typeof branches
declare module 'react-visual-novel' {
  interface Branches extends MyBranches {}
}

export default function MyGame() {
  return (
    <div style={{display: 'flex', width: '100vw', height: '100vh'}}>
      <Game assets={assets} branches={branches} initialBranchId="Intro" />
    </div>
  )
}

Development

Before you can start developing, please make sure that you have pnpm installed (npm install -g pnpm). Then install the dependencies using pnpm: pnpm install.

For local development, you can use pnpm dev.

License

MIT License © Utility First

You might also like...
React Ticker for the Web
React Ticker for the Web

React Flip Ticker yarn add react-flip-ticker npm install react-flip-ticker import { Ticker } from "react-flip-ticker"; Live Demo on Code Sandbox Migr

React web app presenting animate on scrolling

💝 Loading While Scrolling Project Video Preview 💝 Landing.While.Scrolling.Project.Demo.mp4 ✨ Click Here To See Youtube Tutorial 👉 Real Project Prev

JavaScript implementation of the Web Animations API

What is Web Animations? A new JavaScript API for driving animated content on the web. By unifying the animation features of SVG and CSS, Web Animation

Stock-metrics - A web(mobile-focused) app for checking the companies listed on the stock exchange and see their live metrics
Stock-metrics - A web(mobile-focused) app for checking the companies listed on the stock exchange and see their live metrics

Stock Metrics Stock metrics is a web(mobile-focused) app for checking the compan

Micael - The Ultimate Web Development Portfolio
Micael - The Ultimate Web Development Portfolio

This is a code repository for the corresponding YouTube video. In this tutorial we are going to build and deploy a real time chat application. Covered topics: React.js, SCSS, Framer Motion, Sanity

AutoAnimate is a zero-config, drop-in animation utility that adds smooth transitions to your web app
AutoAnimate is a zero-config, drop-in animation utility that adds smooth transitions to your web app

Add motion to your apps with a single line of code. AutoAnimate is a zero-config, drop-in animation utility that adds smooth transitions to your web a

A React library to work with lottie animations inside React.js

React Lottie Tools This React library helps to work with lottie animations inside React.js Info This library is an abstraction of the official lottie

react-animated-numbers - 👾 Library showing animation of number changes in react.js

react-animated-numbers - 👾 Library showing animation of number changes in react.js

React Just Parallax - React library for scroll and mousemove parallax effect
React Just Parallax - React library for scroll and mousemove parallax effect

React Just Parallax React library for scroll and mousemove parallax effect ✨ Open source, production-ready This repo contains the source code for Reac

Releases(v0.2.2)
✌️ A spring physics based React animation library

✌️ A spring physics based React animation library

Poimandres 24.7k Jan 1, 2023
✌️ A spring physics based React animation library

react-spring is a spring-physics based animation library that should cover most of your UI related animation needs. It gives you tools flexible enough

Poimandres 24.7k Jan 4, 2023
React components for the Web Animations API - http://react-web-animation.surge.sh

react-web-animation react-web-animation is a set of React components that expose the Web Animations API in a declarative way. Demos Check out how you

Charles King 294 Dec 2, 2022
A small but powerful animation library for React, built on Web Animations API

A small but powerful animation library for React, built on Web Animations API

null 11 Dec 31, 2022
A wrapper over Motion One, An animation library, built on the Web Animations API for the smallest filesize and the fastest performance

A wrapper over Motion One, An animation library, built on the Web Animations API for the smallest filesize and the fastest performance. Works with solid-js

Tanvesh Sarve 48 Dec 27, 2022
Scroll-based actions and animations for react

react-spark-scroll React port of spark-scroll. The future! This repo has been around for a little while now. However, recently I re-created the demo u

Gil Birman 354 Oct 27, 2022
Very simple react component for rotate element based on scroll position

Very simple react component for rotate element based on scroll position

null 6 Oct 19, 2022
Create frame-based animations in React

React Keyframes A React component for creating frame-based animations. Example The following example will render contents in Frame one at a time every

Vercel 609 Dec 31, 2022
WeDelivery - A Spring and React based dispatch & delivery management application.

WeDelivery WeDelivery is a Spring and React based dispatch & delivery management application. Our service is to use robots and drones to help users in

Leluth 8 Dec 16, 2022
Data representation and manupulation in React JS Function Based Components

Description Data representation and manupulation in React JS Function Based Components. Count, Self Increasing Seconds Data Representation Todo List D

Chanchal Kumar Mandal 1 May 8, 2022