- Welcome
- Getting started
- Monthly update
- Foundations
-
Components
- Accordion
- Alert
- Alignment
- Aria Live
- Autosuggest
- Badge
- Banner Alert
- Bar Chart
- Blockquote
- Bottom Navigation
- Bottom Sheet
- Breadcrumb
- Breakpoint
- Button
- Calendar
- Card
- Card Button
- Carousel
- Checkbox
- Chip
- 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
- Infinite Scroll
- Link
- List
- Map
- Mobile Scroll Container
- Modal
- Navigation Bar
- Nudger
- Overlay
- Page Indicator
- Pagination
- Panel
- Phone Input
- Picker
- Popover
- Price
- Progress Bar
- Radio Button
- Rating
- Scrollable Calendar
- Section List
- Select
- Skeleton
- Skip Link
- Slider
- Snackbar
- Spinner
- Split Input
- Star Rating
- Switch
- Table
- Text
- Text Input
- Theming
- Ticket
- Toast
- Tooltip
- Touchable Native Feedback
- Touchable Overlay
- Content
- Accessibility
Rating
The rating component is used to represent a score as an exact number.
Rating
Default
Day | Night |
---|---|
![]() |
![]() |
Installation
Backpack Compose is available through Maven Central. Check the main Readme for a complete installation guide.
Usage
Example of a Rating:
import net.skyscanner.backpack.compose.rating.BpkRating
BpkRating {
BpkRating(
title = "Title",
subtitle = "Subtitle",
value = 4.5,
)
}
Example of a large Rating:
import net.skyscanner.backpack.compose.rating.BpkRating
import net.skyscanner.backpack.compose.rating.BpkRatingSize
BpkRating {
BpkRating(
title = "Title",
subtitle = "Subtitle",
value = 4.5,
size = BpkRatingSize.Large,
)
}
Example of a title only Rating:
import net.skyscanner.backpack.compose.rating.BpkRating
BpkRating {
BpkRating(
title = "Title",
value = 4.5,
)
}
Example of a Rating with no scale:
import net.skyscanner.backpack.compose.rating.BpkRating
BpkRating {
BpkRating(
title = "Title",
subtitle = "Subtitle",
value = 4.5,
showScale = false,
)
}
Example of a Rating with 0-10 scale:
import net.skyscanner.backpack.compose.rating.BpkRating
import net.skyscanner.backpack.compose.rating.BpkRatingScale
BpkRating {
BpkRating(
title = "Title",
subtitle = "Subtitle",
value = 4.5,
scale = BpkRatingScale.ZeroToTen,
)
}
Example of a Rating with custom content:
import net.skyscanner.backpack.compose.rating.BpkRating
BpkRating {
BpkRating(
subtitle = "Subtitle",
value = 4.5,
) {
// custom content
}
}
Made with ❤️ by Skyscanner © 2023
© 2023 Skyscanner Backpack. Page last updated on Nov 14, 2022, 09:49