Skip to main content

BottomSheet

A surface containing supplementary content that are anchored to the bottom of the screen.

Submit feedback
github
import { BottomSheet } from '@uhg-abyss/mobile';

Example

Scrolling

When the content of the BottomSheet becomes too long to display, scrolling is automatically enabled. In code, the height of the content is compared to the max height of the BottomSheet, which is 90% of the screen.

To manually disable scrolling, setting scrollEnabled to false will switch the component from a ScrollView to a View. Default is true, meaning the height of the content will determine scrollability.

Closing on Background Press

By default, the BottomSheet will close when the user taps on the background overlay. This can be disabled by setting the disableOverlayPress prop to true.

Advanced Layout

Layouts like BottomSheet and Modal can be used in combination with each other to create flows.

BottomSheet Props

Prop NameTypeDefaultDescription
childrennode-The content of the BottomSheet
disableOverlayPressbooleanfalseToggle closing the BottomSheet when the user clicks on the background overlay
footernode-Content that will be at the bottom of the BottomSheet (generally used for buttons)
footerVariantsticky | nestednestedThe variant of the footer
headingstring-The heading of the BottomSheet
hideBorderbooleanfalseFlag to hide the border at the top of the BottomSheet
isVisiblebooleanfalseVariable used to control the visible state of the BottomSheet
onClosefunction-Function called on BottomSheet close
scrollEnabledbooleantrueEnable or disable ScrollView on the BottomSheet

BottomSheet Classes

Class NameDescription
abyss-bottom-sheet-backgroundBottomSheet background element
abyss-bottom-sheet-close-buttonBottomSheet close button
abyss-bottom-sheet-close-iconBottomSheet close icon
abyss-bottom-sheet-containerBottomSheet container element
abyss-bottom-sheet-content-containerBottomSheet content element
abyss-bottom-sheet-footer-containerBottomSheet footer element
abyss-bottom-sheet-headerBottomSheet header element
abyss-bottom-sheet-header-containerBottomSheet header container
abyss-bottom-sheet-headingBottomSheet heading text
abyss-bottom-sheet-overlayBottomSheet overlay element
abyss-bottom-sheet-rootBottomSheet root element
abyss-bottom-sheet-top-barBottomSheet top bar element

BottomSheet Translations

Translation KeyValue
closeClose

Focus Guidance

Abyss does not control the focus of components on the screen when the BottomSheet is toggled off. To meet accessibility guidelines, the focus must be set to the previous node when closed. The useSetFocus hook can be used for this.

For example, if a button is pressed to open a BottomSheet, focus must return to that button once it is closed, so that a screen reader or keyboard user may continue using the app where they left off.

BottomSheet Tokens

Token NameValue
bottom-sheet.color.surface.container
#FFFFFF
bottom-sheet.color.surface.handle
#CBCCCD
bottom-sheet.color.surface.overlay
rgba(0,0,0,0.4)
bottom-sheet.color.border.header
#CBCCCD
bottom-sheet.color.text.heading
#002677
bottom-sheet.color.text.paragraph
#4B4D4F
bottom-sheet.color.icon.close.rest
#4B4D4F
bottom-sheet.color.icon.close.active
#323334
bottom-sheet.border-radius.top.header
16
bottom-sheet.border-width.bottom.header
1
bottom-sheet.sizing.all.icon.close
24
bottom-sheet.sizing.width.handle
80
bottom-sheet.sizing.height.handle
4
bottom-sheet.spacing.padding.all.header-content
16
bottom-sheet.spacing.padding.all.paragraph
16
bottom-sheet.spacing.padding.top.header
8
bottom-sheet.spacing.padding.top.container
80
bottom-sheet.spacing.gap.horizontal.header-content
24

BottomSheet Classes

V2V1Status
bottom-sheet-backgroundbottom-sheet-backgroundUnchanged
bottom-sheet-close-buttonbottom-sheet-close-buttonUnchanged
bottom-sheet-close-iconbottom-sheet-close-iconUnchanged
bottom-sheet-containerbottom-sheet-containerUnchanged
bottom-sheet-content-containerbottom-sheet-content-containerUnchanged
bottom-sheet-footer-containerbottom-sheet-footer-containerUnchanged
bottom-sheet-headerbottom-sheet-headerUnchanged
bottom-sheet-header-containerbottom-sheet-header-containerUnchanged
bottom-sheet-headingbottom-sheet-titleRenamed
bottom-sheet-overlaybottom-sheet-overlayUnchanged
bottom-sheet-rootbottom-sheet-rootUnchanged
bottom-sheet-top-barbottom-sheet-top-barUnchanged

BottomSheet Props

V2V1Status
childrenchildrenUnchanged
disableOverlayPressdisableOverlayPressUnchanged
footerfooterUnchanged
headingtitleRenamed
isVisibleisVisibleUnchanged
onCloseonCloseUnchanged
scrollEnabledscrollEnabledUnchanged
Table of Contents