@berlitz/nav-widget

3.3.12 • Public • Published

Component Name npm version

Provides a navigation bar useful for navigating different audiences to different webpages.

This component is used in the PageBanner of most Blitz websites.

Intended to work with the Course Wizard content type

Installation

yarn add @berlitz/nav-widget

Props

Prop Type Required Default Description
children element - Used to add the submit button
data array - Array of audience options. See propTypes for the shape.
defaultOption object - The audience option that should be selected by default.

Usage

import NavWidget from '@berlitz/nav-widget'

const SubmitButton = ({ label, firstOption, secondOption }) => {
  const linkUrl = secondOption || firstOption
  return <StyledNavLink to={linkUrl}>{label}</StyledNavLink>
}

const MyApp = () => (
  <NavWidget data={data} defaultOption={data[1]}>
    <SubmitButton />
  </NavWidget>
)

Readme

Keywords

none

Package Sidebar

Install

npm i @berlitz/nav-widget

Weekly Downloads

1,535

Version

3.3.12

License

MIT

Unpacked Size

43.5 kB

Total Files

6

Last publish

Collaborators

  • berlitz