Slider
wrapper creates and renders a 3D interactive slider in a react applicationmaxValue
prop sets the max value of the slider. Defaults to 10.steps
prop sets the increment of each tick/mark. If you want the slider to be in increments of 3, then steps would be 3. Defaults to 2.onChange
prop takes in the callback function that is fired when the sliders value changes. Will take in a number corresponding to slider position. Recommended that the function be a useState hookvalue
prop is used to show a visual number that corresponds with each position. Should be the output of theonChange
prop.Example
import { Canvas } from "@react-three/fiber";
import { Slider } from "r3dy";
export default function App() {
return (
<Canvas>
<Slider />
</Canvas>
);
}