Introducing Nuvyx UI v1.0.0

Docs
MS Paint

MS Paint

A customizable drawing canvas component with paint-like interface.

My Drawing App
FileEditToolsHelp
For Help, click Help Topics on the Help Menu.

Installation

Usage

import { MSpaint } from "@/components/ui/ms-paint";
// Basic usage with default settings
<MSpaint />
 
// Custom size and title
<MSpaint
  width={1000}
  height={600}
  title="My Drawing App"
/>
 
// Custom colors and brush settings
<MSpaint
  colorPalette={["#ff0000", "#00ff00", "#0000ff", "#ffff00", "#ff00ff", "#00ffff"]}
  brushSize={5}
  eraseSize={30}
/>
 
// With save callback
<MSpaint
  onSave={(canvas) => {
    const image = canvas.toDataURL('image/png');
    console.log('Canvas saved:', image);
  }}
/>

Props

PropTypeDefaultDescription
widthnumber800Width of the drawing canvas container in pixels
heightnumber500Height of the drawing canvas area in pixels
canvasWidthnumber2000Width of the actual canvas element (determines draw area)
canvasHeightnumber2000Height of the actual canvas element (determines draw area)
colorPalettestring[]DEFAULT_COLORSArray of hex color codes for the color palette
titlestring'untitled - Paint'Title text displayed in the window header
menuItemsstring[]['File', 'Edit', 'View', 'Image', 'Options', 'Help']Array of menu item names to display in the menu bar
classNamestring''Additional CSS classes to apply to the container
styleReact.CSSProperties{}Additional inline styles to apply to the container
onSave(canvas: HTMLCanvasElement) => voidundefinedCallback function when the save button is clicked
brushSizenumber2Size of the brush used for drawing
eraseSizenumber20Size of the eraser used for erasing