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
yarn add @berlitz/nav-widget
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. |
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>
)