- 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.
HorizontalNavigation
Default
Day | Night |
---|---|
Usage
@State var selectedTab: Int = 0
BPKHorizontalNavigation(
tabs: [
.init(title: "Flights", icon: .flight, onClick: { selectedTab = 0 }),
.init(title: "Hotels", icon: .hotel, onClick: { selectedTab = 1 }),
.init(title: "Cars", icon: .car, onClick: { selectedTab = 2 }),
],
selectedTab: selectedTab
)
Setting the Size
BPkHorizontalNavigation supports both a default and a small size.
@State var selectedTab: Int = 0
BPKHorizontalNavigation(
tabs: [
.init(title: "Flights", icon: .flight, onClick: { selectedTab = 0 }),
.init(title: "Hotels", icon: .hotel, onClick: { selectedTab = 1 }),
.init(title: "Cars", icon: .car, onClick: { selectedTab = 2 }),
],
size: .small,
selectedTab: selectedTab
)
Tabs withou icons
@State var selectedTab: Int = 0
BPKHorizontalNavigation(
tabs: [
.init(title: "Flights", onClick: { selectedTab = 0 }),
.init(title: "Hotels", onClick: { selectedTab = 1 }),
.init(title: "Cars", onClick: { selectedTab = 2 }),
],
selectedTab: selectedTab
)
Made with ❤️ by Skyscanner © 2024
© 2024 Skyscanner Backpack. Page last updated on Apr 11, 2024, 17:05