person-iconAbout us
Button Icon

Button

The button component is a clickable 3D button.

Scale

The

scale

prop defines the button size. Change it by passing a number.

Position

The

position

prop defines the button position. Change it by passing X, Y, Z coordinates as an array of numbers.

Color

The

color

prop defines the button color. Change it by passing a color name or hex code as a string.

HoverColor

The

hoverColor

prop defines the button color on hover. Change it by passing a color name or hex code as a string.

Text

The

text

prop defines the button text. Change it by passing a string.

Font

The

font

prop defines the font of the button text. Change it by passing a file path as a string.

Font Size

The

fontSize

prop defines the font size of the button text. Change it by passing a number.

Font Color

The

fontColor

prop defines the color of the button text. Change it by passing a color name or hex code as a string.

HandleClick

The

handleClick

prop defines a callback function for the button’s onClick event. Set it by passing a function.

Code Sample

Example

codesandbox-iconOpen Sandbox
import { Canvas } from "@react-three/fiber";
import { Button } from "r3dy";

export default function App() {
  return (
      <Canvas>
        <Button />
      </Canvas>
  );
}