ViroVirtualButton is a native-rendered circular button. It pairs with ViroVirtualJoystick via a shared controllerId, writing button state into the same VROInputState registry entry.
Import
import { ViroVirtualButton } from "@reactvision/react-viro";
Props
controllerId (* required)
Type
Description
string
Shared controller ID. Must match the joystick / other buttons you want to share state with.
button (* required)
Type
Description
ViroButtonName
Which button bit to set.
size
Type
Description
number
Circle diameter in dp/points. Default: 44.
tintColor
Type
Description
string | number
Button fill color. Default: rgba(255,255,255,0.6).
onPressIn
Type
Description
(e) => void
Fires on touch-down.
onPressOut
Type
Description
(e) => void
Fires on touch-up or cancel.
style
Type
Description
StyleProp<ViewStyle>
Must include explicit width and height.
ViroButtonName
type ViroButtonName =
| "A"
| "B"
| "X"
| "Y"
| "Z"
| "L1"
| "R1"
| "L2"
| "R2"
| "Start"
| "Select";
🚧
Explicit size required
Like ViroVirtualJoystick, this component has no intrinsic size. Always set style={{ width: N, height: N }} or it collapses to 0×0 and receives no touch events.