Example
import reflex as rx
class Spline(rx.Component):
"""Spline component."""
# The name of the npm package.
library = "@splinetool/react-spline"
# Any additional libraries needed to use the component.
lib_dependencies: list[str] = [
"@splinetool/runtime@1.5.5"
]
# HERE!!!
additional_commands: list[str] = ['npm install some-package --save-dev', '<a command that downloads an asset from a link>']
# The name of the component to use from the package.
tag = "Spline"
# Spline is a default export from the module.
is_default = True
# Any props that the component takes.
scene: rx.Var[str]
# Convenience function to create the Spline component.
spline = Spline.create
# Use the Spline component in your app.
def index():
return spline(
scene="https://prod.spline.design/joLpOOYbGL-10EJ4/scene.splinecode"
)
Example