1.1.0 • Published 2 years ago

react-google-signin-button v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-google-signin-button

Preview Image

"Sign in with Google" button for React. Follows the official guidelines. Note that this module does not provide authentication itself; it only offers a button.

Installation

$ npm install react-google-signin-button

Usage

Import GoogleButton component and required CSS file.

import GoogleButton from 'react-google-signin-button';
import 'react-google-signin-button/dist/button.css';

function App() {
  return (
    <div>
      <GoogleButton
        onClick={() => { console.log('Google button clicked'); }}
      />
    </div>
  );
}

Why are the styles in external CSS file and not as inline styles?

Using an external CSS file allows you to make small adjustments by adding your own CSS. Pseudo-classes :active and :focus cannot be used with inline styles without adding NPM dependencies.

Props

NameTypeDefault ValueDescription
labelstringSign in with GoogleText in the button. See Google documentation.
themestringlightlight, dark or neutral
shapestringrectangularrectangular, pill, square or circle. Use square or circle when you want the logo only.
sizestringmdlg, md, or sm
logoAlignstringleftWhen using custom width, the logo can be aligned with this. left or center

Other props are passed to the button element, such as:

  • onClick
  • disabled
  • className
  • style

Development

$ npm run rollup

This builds files under dist/ directory.

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago