Skip to content

A wrapper to painlessly integrate Spline projects into your React code-space. ☀

Notifications You must be signed in to change notification settings

usApp-stAck/react-spline

Repository files navigation

React Spline

NPM JavaScript Style Guide

A painless, configurable, spline wrapper for React to add sweet animations easily into your projects.

Install

npm install --save react-spline

or

yarn add react-spline

Usage

Import the Spline component from react-spline, and include the stylesheet from react-spline/dist/react-spline.modern.css. You're set.

import React, { Component } from 'react'

import { Spline } from 'react-spline'
import 'react-spline/dist/react-spline.modern.css'

class Example extends Component {
  render() {
    return <Spline scene={SCENE_OBJECT} />
  }
}

Props

Property Description
scene object Required. The scene object exported from Spline.
assets object Default { fonts: [], images: [], models: [], animations: [] }. The assets object exported from Spline.
id string Default empty. Assignable HTMLAttribute id for the <canvas> element.
className string Default empty. Assignable HTMLAttribute class for the <div> wrapper.
style JSX CSS Default empty. Custom styling for the <div> wrapper.
canvasStyle JSX CSS Default empty. Custom styling for the <canvas> element.

License

MIT © utkarshdubey

About

A wrapper to painlessly integrate Spline projects into your React code-space. ☀

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 97.5%
  • HTML 1.2%
  • TypeScript 1.1%
  • CSS 0.2%