0.1.0 • Published 5 years ago
@dougrich/react-signin-reddit v0.1.0
react-signin-reddit
React component for a sign in button styled according to reddit brand guidelines
Branding guidelines found here: https://www.reddit.com/wiki/licensing
This does:
- provide a button that can be placed anywhere (see positioning guidelines in branding document)
- button can either by a
button
tag or ana
tag: see usage below - provide a button style that renders a link to include roboto font for sign in (see advanced usage below)
This does not:
- provide any OAuth hooks or means to actually sign in (just the UX)
Install
npm install --save @dougrich/react-signin-reddit
Usage
Simple
import React, { Component } from 'react'
import SignInButton from '@dougrich/react-signin-reddit'
class Example extends Component {
render () {
return (
<SignInButton onClick={...} />
)
}
}
Only Light/Dark
// light button
import SignInButton from '@dougrich/react-signin-reddit/dist/light'
// dark button
import SignInButton from '@dougrich/react-signin-reddit/dist/dark'
As Link
import React, { Component } from 'react'
import SignInButton from '@dougrich/react-signin-reddit'
class Example extends Component {
render () {
return (
<SignInButton as='a' href='#' />
)
}
}
Disabled
Note that for a
tags only, when disabled it will remove the href
attribute (if passed).
import React, { Component } from 'react'
import SignInButton from '@dougrich/react-signin-reddit'
class Example extends Component {
render () {
return (
<SignInButton disabled onClick={...} />
)
}
}
License
Code is licensed under MIT © dougrich
Images located in the signin-assets
are taken from here, available under the terms described in their brand guidlines.
0.1.0
5 years ago