@berlitz/nav-widget
v3.3.12
Published
NavWidget component for the Max Design System
Downloads
6,032
Readme
Component Name
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>
)