Coder Social home page Coder Social logo

trendingtechnology / react-native-drag-text-editor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eneskarpuz/react-native-drag-text-editor

1.0 1.0 0.0 62 KB

React Native Drag Text Editor for photo editing / manipulation cases.

License: MIT License

JavaScript 100.00%

react-native-drag-text-editor's Introduction

React Native Drag Text Editor

React Native Drag Text Editor is kind a Text Editor still in development for photo editing / manipulation cases.

Showcase [ IOS13 / AndroidAPI30 ]

Check https://github.com/eneskarpuz/TextEditorPlus for full Example in Readme.

IOS13 AndroidAPI30

  • Drag and Drop Text
  • Resize Text
  • Edit & Type

Installation

$ npm install react-native-drag-text-editor --save

IOS

  • Don't forget Pods.
$ pod install

Usage

import React, { Component } from "react";
import {Dimensions} from "react-native";
import DragTextEditor from 'react-native-drag-text-editor';
const WINDOW = Dimensions.get('window');

export default class App extends Component {
  constructor(props) {
    super(props);
  };

  render() {
    return (  
        <DragTextEditor
          minWidth={100}
          minHeight={100}
          w={200}
          h={200}
          x={WINDOW.width/4}
          y={WINDOW.height/3}
          FontColor={"#000000"}
          LineHeight={15}
          TextAlign={"left"}
          LetterSpacing={0}
          FontSize={15}
          isDraggable={true}
          isResizable={true}
          TopRightAction={()=>console.log("-Top Right Pressed")}
          centerPress={()=>console.log("-Center Pressed")} 
          onDragStart={()=>console.log("-Drag Started")}
          onDragEnd={()=>console.log("- Drag ended")}
          onDrag={()=>console.log("- Dragging...")}
          onResizeStart={()=>console.log("- Resize Started")}
          onResize={()=>console.log("- Resizing...")}
          onResizeEnd={()=>console.log("- Resize Ended")}
        /> 
  }
 )
}

Properties

Prop Default Type Description
centerPress - function Center Pressed handler
TopRightAction - function Top Right Press handler
TopLeftAction - function Top Right Press handler
isDraggable true boolean Draggable condition
isResizable true boolean Resizable condition
onDragStart - function Drag Start event handler
onDrag - function Drag handler
onDragEnd - function Drag End event handler
onResizeStart - function Resize Start event handler
onResize - function Resize event handler
onResizeEnd - function Resize End event handler
TopLeftIcon ./icons/compassed.png function Clickable Top Left Icon Function Component
TopRightIcon ./icons/closed.png function Clickable Top Right Icon Function Component
text Lorem Ipsum... String Value of text
FontFamily Roboto String Font Family
FontColor #000 String Text Color
FontSize 15 String Font Size
LetterSpacing 0 String Letter Spacing
BackgroundColor transparent String Background Color
TextAlign Roboto String Text Align
LineHeight 18 String Line Height
x 80 String X location of Components
y 150 String Y location of Components
w 200 Number First Width
h 200 Number First Height
minWidth 200 Number Minimum Width
minHeight 200 Number Minimum Height

Features

Performs(Visible) in Black and White backgrounds

Logs

To Do

  • Performance Optimization (Code Duplicates etc.)
  • textID and textInAction Bug (Type Error)
  • Dynamic Border Management
  • Add Rotation/Rotate Icon
  • Add Center-Snap

License

This project is licensed under the MIT License.

react-native-drag-text-editor's People

Contributors

eneskarpuz avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.