3.2.7 • Published 7 years ago

auth0-web-header v3.2.7

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

Auth0 Web Header

Auth0's website and landings react component header

Installation

From npm client:

npm install --save auth0-web-header

From yarn client:

yarn add auth0-web-header

From CDN:

<link rel="stylesheet" href="https://cdn.auth0.com/website/web-header/3.0.0/web-header.css" />
<script src="https://cdn.auth0.com/website/web-header/3.0.0/web-header.js"></script>

Usage

API

Props

PropsTypeDefaultDescription
classNamestring''Applied to the header root element.
childrennodenullCan be used to render custom menu items via React components.
themestring'light'Header theme, another option is 'dark'.
featuredEnablebooleantrueEnable or disable featured link next to the Auth0 logo.
featuredLinkstring''Featured link URI.
featuredTextstring''Featured link text.
loginButtonEnablebooleantrueEnable or disable Login button.
loginButtonLinkstring''Link of the Login button, if it's different from '' the Login button will be rendered as an anchor tag with this href.
loginButtonOnClickfunction() => {}Callback function for when Login button is clicked.
loginButtonTextstring'Log in'Text of the Login button.
talkToSalesButtonEnablebooleantrueTalk to sales button link.
talkToSalesButtonLinkstring'?contact=true'Link of the Talk to sales button, if it's different from '' the Talk to sales button will be rendered as an anchor tag with this href.
talkToSalesButtonOnClickfunction() => {}Callback function for when Talk to sales button is clicked.
talkToSalesButtonTextstring'Talk to sales'Text of the Talk to sales button.
signupButtonEnablebooleantrueSignup button link.
signupButtonLinkstring''Link of the Signup button, if it's different from '' the Signup button will be rendered as an anchor tag with this href.
signupButtonOnClickfunction() => {}Callback function for when Signup button is clicked.
signupButtonTextstring'Sign up'Text of the Signup button.

Methods

Get a variant for the ribbon:

import Auth0WebHeader from 'auth0-web-header'

Auth0WebHeader.getRibbon()

Example

Example of usage with lock

src/components/Header/index.js

import React, { Component } from 'react'
import Auth0WebHeader from 'auth0-web-header'
import Auth0Lock from 'auth0-lock'
import { auth0ClientId, auth0Domain, auth0CallbackUrl } from '../config'

class Header extends Component {
  mainLock = {}

  componentDidMount() {
    this.mainLock = {
      lock: new Auth0Lock(auth0ClientId, auth0Domain),
      options: {
        icon: auth0IconUrl,
        callbackURL: auth0CallbackUrl,
        rememberLastLogin: true,
        integratedWindowsLogin: false,
        dict: {
          signup: {
            footerText: 'By signing up, you agree to our <a href="/terms" target="_new">terms of service</a> and <a href="/privacy" target="_new">privacy policy</a>'
          }
        }
      }
    }
  }

  showLock = () => {
    const { lock, options } = this.mainLock
    lock.show(options)
  }

  render() {
    const { dark, logged } = this.props
    return logged
      ? <Auth0WebHeader theme={dark} primaryButtonText="Open Dashboard" primaryButtonLink="https://manage.auth0.com/" />
      : <Auth0WebHeader theme={dark} primaryButtonOnClick={this.showLock} />
  }
}

src/styles/main.styl

@import '../../node_modules/auth0-web-header/build/web-header.css'

Development

Run:

git clone git@github.com:auth0/web-header.git
cd web-header
yarn
yarn run start:dev

And point your browser to the playgrounds:

Release

To release a new version just commit a package.json version change. And changelog entry, git tag, cdn deploy and npm publish will be triggered automatically.

Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.

License

Auth0 Web Header is MIT licensed.

3.2.7

7 years ago

3.2.6

7 years ago

3.2.5

7 years ago

3.2.4

7 years ago

3.2.3

7 years ago

3.2.2

7 years ago

3.2.1

7 years ago

3.2.0

7 years ago

3.1.9

7 years ago

3.1.8

7 years ago

3.1.7

7 years ago

3.1.6

7 years ago

3.1.5

7 years ago

3.1.4

7 years ago

3.1.3

7 years ago

3.1.2

7 years ago

3.1.1

7 years ago

3.1.0

7 years ago

3.0.2

7 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.4.0

7 years ago

1.3.10

7 years ago

1.3.9

7 years ago

1.3.8

7 years ago

1.3.7

7 years ago

1.3.6

7 years ago

1.3.5

7 years ago

1.3.4

7 years ago

1.3.3

7 years ago

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

8 years ago

1.2.42

8 years ago

1.2.41

8 years ago

1.2.40

8 years ago

1.2.39

8 years ago

1.2.38

8 years ago

1.2.37

8 years ago

1.2.36

8 years ago

1.2.35

8 years ago

1.2.34

8 years ago

1.2.33

8 years ago

1.2.32

8 years ago

1.2.31

8 years ago

1.2.30

8 years ago

1.2.29

8 years ago

1.2.28

8 years ago

1.2.27

8 years ago

1.2.26

8 years ago

1.2.25

8 years ago

1.2.24

8 years ago

1.2.23

8 years ago

1.2.22

8 years ago

1.2.21

8 years ago

1.2.20

8 years ago

1.2.19

8 years ago

1.2.18

8 years ago

1.2.17

8 years ago

1.2.16

8 years ago

1.2.15

8 years ago

1.2.14

8 years ago

1.2.13

8 years ago

1.2.12

8 years ago

1.2.11

8 years ago

1.2.10

8 years ago

1.2.9

8 years ago

1.2.8

8 years ago

1.2.7

8 years ago

1.2.6

8 years ago

1.2.5

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.7

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.36

8 years ago

1.0.35

8 years ago

1.0.34

8 years ago

1.0.33

8 years ago

1.0.32

8 years ago

1.0.31

8 years ago

1.0.30

8 years ago

1.0.29

8 years ago

1.0.28

8 years ago

1.0.27

8 years ago

1.0.26

8 years ago

1.0.25

8 years ago

1.0.24

8 years ago

1.0.23

8 years ago

1.0.22

8 years ago

1.0.21

8 years ago

1.0.20

8 years ago

1.0.19

8 years ago

1.0.18

8 years ago

1.0.17

8 years ago

1.0.16

8 years ago

1.0.15

8 years ago

1.0.14

8 years ago

1.0.13

8 years ago

1.0.12

8 years ago

1.0.11

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago