- Welcome
- Getting started
- Latest updates
- Foundations
-
Components
- Accordion
- Alert
- Alignment
- App Search Modal
- Aria live
- Autosuggest
- Badge
- Banner alert
- Bar chart
- Blockquote
- Bottom navigation
- Bottom sheet
- Breadcrumb
- Breakpoint
- Button
- Calendar
- Card
- Card list
- Card button
- Carousel
- Checkbox
- Chip
- Chip group
- Code
- Content cards
- Data Table
- Datepicker
- Description list
- Dialog
- Divider
- Drawer
- Field Set
- Flare
- Flat list
- Flight leg
- Floating action button
- Floating notification
- Form label
- Form validation
- Graphic promotion
- Horizontal navigation
- Icon
- Image
- Image Gallery
- Infinite scroll
- Info Banner
- Inset Banner
- Link
- List
- Map
- Mobile scroll container
- Modal
- Navigation bar
- Navigation Tab Group
- Nudger
- Overlay
- Page indicator
- Pagination
- Panel
- Phone input
- Picker
- Popover
- Price
- Progress bar
- Radio button
- Rating
- Rating Bar
- Scrollable calendar
- Search Modal
- Section header
- Section list
- Select
- Skeleton
- Skip link
- Slider
- Snackbar
- Snippet
- Spinner
- Split input
- Star rating
- Swap Button
- Switch
- Table
- Text
- Text input
- Theming
- Ticket
- Toast
- Tooltip
- Touchable native feedback
- Touchable overlay
- Search Input Summary
- Content
- Accessibility
- Contributing
- Localisation
Horizontal navigation
A simple navigation component, ideal for representing a section of a page that links to other pages or views within the page.
Default
By default, navigation items are left aligned.
With disabled item
A navigation item can be disabled.
Space around
Navigation items can be configured to have space around them.
Not Underlined
The border that covers the bottom of the component can be hidden.
Light appearance
An alternate appearance is available for display over dark backgrounds.
bpk-component-horizontal-nav
Backpack horizontal nav component.
Installation
Check the main Readme for a complete installation guide.
Usage
import { Component } from 'react';
import BpkHorizontalNav, { BpkHorizontalNavItem } from '@skyscanner/backpack-web/bpk-component-horizontal-nav';
export default class App extends Component {
constructor() {
super();
this.state = {
selected: 'flights',
};
}
onClick = (e) => {
this.setState({
selected: e.target.name,
});
}
render() {
return (
<BpkHorizontalNav>
<BpkHorizontalNavItem
name="flights"
selected={this.state.selected === 'flights'}
onClick={this.onClick}
>
Flights
</BpkHorizontalNavItem>
<BpkHorizontalNavItem
name="hotels"
selected={this.state.selected === 'hotels'}
onClick={this.onClick}
>
Hotels
</BpkHorizontalNavItem>
<BpkHorizontalNavItem
name="car-hire"
selected={this.state.selected === 'car-hire'}
onClick={this.onClick}
>
Car hire
</BpkHorizontalNavItem>
</BpkHorizontalNav>
);
}
};
Props
Check out the full list of props on Skyscanner's design system documentation website.
Props
Made with ❤️ by Skyscanner © 2024
© 2024 Skyscanner Backpack. Page last updated on Oct 2, 2023, 15:54