react-img-rz

Cambio de imagen con Reactjs

Usage no npm install needed!

<script type="module">
  import reactImgRz from 'https://cdn.skypack.dev/react-img-rz';
</script>

README

# use npm
$ npm install --save react-img-rz

# use yarn
$ yarn add --save react-img-rz

Programacion(Uso)

import React from 'react';
import Image from 'react-img-rz';

export class ejemplo extends Component {
  render() {
   let value={img:'path/to/image.jpg',size:240};
    return (
      <>
        <Image
            src={value.img}
            width={value.size}
            height={value.size}
            style={{position: 'initial',display: 'unset',}}
            />
      </>
    );
  }
}

Opciones

name required type default description
src true String '' Path de tu imagen
alt false String '' Descripcion de la Imagen
height true Number 0 Height despues de cambiar su tamaño (solo px)
width true Number 0 Width despues de cambiar su tamaño (solo px)
style false object Estilo de la imagen (style css)

License

This project is licensed under the terms of the MIT license.