https://github.com/srinath10x/expo-doodle
A simple and minimal drawing library for Expo.
https://github.com/srinath10x/expo-doodle
drawing expo npm-package react-native
Last synced: 11 months ago
JSON representation
A simple and minimal drawing library for Expo.
- Host: GitHub
- URL: https://github.com/srinath10x/expo-doodle
- Owner: Srinath10X
- Created: 2025-01-20T16:28:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-22T06:23:40.000Z (over 1 year ago)
- Last Synced: 2025-08-04T05:17:37.675Z (11 months ago)
- Topics: drawing, expo, npm-package, react-native
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# expo-doodle
A simple and minimal drawing library for Expo.
## Installation
To install `expo-doodle`, run the following command:
```bash
npm install expo-doodle
```
## Usage
Here is a simple example to get started:
```javascript
import { useRef } from "react";
import { View, Button } from "react-native";
import ExpoDoodle from "expo-doodle";
const App = () => {
const undoRef = useRef(() => {});
const clearRef = useRef(() => {});
return (
(clearRef.current = clear)}
undo={(undo) => (undoRef.current = undo)}
/>
undoRef.current()} />
clearRef.current()} />
);
};
export default App;
```
## Props
| Prop | Type | Default | Description |
| ----------------- | -------- | ----------- | ------------------------------------------ |
| `containerStyles` | `object` | `{}` | Custom styles for the canvas container. |
| `color` | `string` | `#000` | The color of the brush. |
| `strokeWidth` | `number` | `4` | The size of the brush in pixels. |
| `undo` | `func` | `undefined` | Callback function to undo the last action. |
| `clear` | `func` | `undefined` | Callback 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.