1.0.8 • Published 5 years ago

react-scaling v1.0.8

Weekly downloads
59
License
MIT
Repository
github
Last release
5 years ago

react-scaling

A solution for developers who want their app to look the same on all desktops no matter the screen size is finally here!

Example

Zooming in out to show scaling of image

How To Install

How To Use

import React from 'react';
import { Scale } from 'react-scaling';

let yeomanImage = require('../images/yeoman.png');

class AppComponent extends React.Component {
  render() {
    return (
      <div className='index'>
        <Scale scaleTo={1280}>
          <img src={yeomanImage} alt='Yeoman Generator' />
        </Scale>
        <div className='notice'>
          This text has <code>no scaling</code> the image above is set to scale
          relative to 1280px!
        </div>
      </div>
    );
  }
}

Difference between Zoom and Scale

Zoom is a lower level component required by Scale. You can use it to dynamically set the zoom amount yourself. <Zoom zoom={25}><MyContent/></Zoom> or if you want to scale relative to the page you can use <Scale scaleTo={1280}><MyContent/></Zoom> this will scale your content up or down depending on the users screen size relative to 1280 pixels. So if their screen is 640px is will set the zoom to 50% in order for it to look the same as those on larger screens.

1.0.8

5 years ago

1.0.76

5 years ago

1.0.75

5 years ago

1.0.74

5 years ago

1.0.73

5 years ago

1.0.72

5 years ago

1.0.71

5 years ago

1.0.7

5 years ago

1.0.63

5 years ago

1.0.62

5 years ago

1.0.61

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.41

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago