Giter VIP home page Giter VIP logo

lemoncode / react-image-focal-point Goto Github PK

View Code? Open in Web Editor NEW
25.0 4.0 2.0 3.51 MB

Let the user set the picture focal point just by visually dragging and dropping on top of the selected image.

Home Page: https://lemoncode.github.io/react-image-focal-point

License: MIT License

Shell 0.19% JavaScript 9.37% TypeScript 84.63% CSS 5.08% HTML 0.73%
react image drag-focal-point react-image-focal-point lemoncode

react-image-focal-point's Introduction

React Image Focal Point

logo

Let the user set the picture focal point just by visually dragging and dropping on top of the selected image.

Live Demo


Edit on StackBlitz Edit on Codesandbox

React image focal point video tutorial


npm npm bundle size npm downloads GitHub Workflow Status

GitHub license GitHub issues GitHub pull requests GitHub last commit

GitHub stars GitHub watchers Twitter Follow

Table of Contents

Installation

Install React Image Focal Point using your favorite package manager like npm:

npm install @lemoncode/react-image-focal-point

or via yarn:

yarn add @lemoncode/react-image-focal-point

This library has peerDependencies listings for react and react-dom. You will need to install these packages in your project in order to use this library.

Quickstart

Import the library styles and the component:

import '@lemoncode/react-image-focal-point/style.css';
import { ImageFocalPoint } from '@lemoncode/react-image-focal-point';

const App = () => {
  return (
    // Your app code
  );
};

Then use the component:

import '@lemoncode/react-image-focal-point/style.css';
import { ImageFocalPoint } from '@lemoncode/react-image-focal-point';

const App = () => {
  return (
    <ImageFocalPoint
      src="your-image-src" // Same src as <img> HTML element
      onChange={focalPoint => {
        // Add here your code to do whatever you want to when the user drags on the focal point
      }}
    />
  );
};

Docs

Check out our official documentation

Examples

You'll find runnable examples in the docs site and in the examples folder.

Key Features

  • Let the user set the picture focal point just by visually dragging and dropping on top of the selected image.

  • You can use it as a controlled or uncontrolled component.

  • You can style the component at any component's level (check out the docs site CSS section).

About Lemoncode + Basefactor

We are an innovating team of Javascript experts, passionate about turning your ideas into robust products.

Lemoncode provides training services.

Basefactor, consultancy by Lemoncode provides consultancy and coaching services.

For the LATAM/Spanish audience we are running an Online Front End Master degree, more info: http://lemoncode.net/master-frontend

react-image-focal-point's People

Contributors

brauliodiez avatar github-actions[bot] avatar nasdan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

creativoma

react-image-focal-point's Issues

Social card

Create a social card image with library logo.

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.