1.1.0 • Published 5 months ago

react-boop v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

react-boop npm License TypeScript

A flexible virtual joystick component for React, built with TypeScript for mobile devicesšŸ“± Simple integration with smooth and intuitive controls for touchscreen environments.

Live Demo

Try the joystick in action on a mobile device:

šŸ‘‰ Live Demo (Try it on your Phone or Tablet)

Designed to work only on mobile and touchscreen devices. It will not respond to mouse or desktop inputs.

Features

  • Exclusively for Mobile Devices – Only responds to touch events (mobile and tablet devices).
  • Written in TypeScript, compatible with both TypeScript and JavaScript React projects
  • Fully customizable size and styles.

Installation

npm install react-boop

Usage

import { VirtualJoystick } from "react-boop";

export default function App() {
  return (
    <VirtualJoystick
      size={150}
      onChange={(vector) => console.log(vector)}
      className="custom-joystick"
      style={{ backgroundColor: "#4A90E2" }}
    />
  );
}

Props

PropTypeDefaultDescription
onChange(vector: {x: number, y: number}) => voidRequiredCallback function for joystick movement.
classNamestring""Custom CSS classes for styling.
styleReact.CSSProperties{}Inline styling for the joystick.
sizenumber96Size of the joystick in pixels.

License

This project is licensed under the MIT License.


Links

1.1.0

5 months ago

1.0.10

5 months ago

1.0.9

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.6

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago