1.0.1 • Published 6 months ago

expo-doodle v1.0.1

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

expo-doodle

A simple and minimal drawing library for Expo.

Installation

To install expo-doodle, run the following command:

npm install expo-doodle

Usage

Here is a simple example to get started:

import { useRef } from "react";
import { View, Button } from "react-native";
import ExpoDoodle from "expo-doodle";

const App = () => {
  const undoRef = useRef(() => {});
  const clearRef = useRef(() => {});

  return (
    <View style={{ flex: 1 }}>
      <ExpoDoodle
        strokeWidth={4}
        color={"black"}
        clear={(clear) => (clearRef.current = clear)}
        undo={(undo) => (undoRef.current = undo)}
      />
      <Button title="Undo" onPress={() => undoRef.current()} />
      <Button title="Clear" onPress={() => clearRef.current()} />
    </View>
  );
};

export default App;

Props

PropTypeDefaultDescription
containerStylesobject{}Custom styles for the canvas container.
colorstring#000The color of the brush.
strokeWidthnumber4The size of the brush in pixels.
undofuncundefinedCallback function to undo the last action.
clearfuncundefinedCallback function to clear the canvas.

Compatibility

expo-doodle is compatible with Expo SDK 49 and above. It works well on both Android and iOS devices.

Contributing

Contributions are welcome! If you have a feature request, bug report, or would like to contribute to the codebase, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.