A painless, configurable, spline wrapper for React to add sweet animations easily into your projects.
npm install --save react-spline
or
yarn add react-spline
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} />
}
}
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. |
MIT © utkarshdubey