Hero Image

Components

Bottom sheet

Beta

This component is in beta. Please report any bugs or errors to Team DesignTech trough the feedback functionality.

Technically Bottom-sheet builds on the drawer component, but has some additional functionality.

Some examples of different Bottom-sheet implementations.

There is also an example of bottom sheet on this page that contains the proptables for all the components used in Bottom-sheet.

Implementation

Bottom Sheet is built using the following components:

  • BottomSheet
  • BottomSheetFooter (optional)

Footer if present, will always be visible, while content will be hidden when collapsed. By setting collapsedHeight, a desired portion of the content will be visible in collapsed state. Use isFixed to get a bottom sheet that is not scrollable and has no drag handle or close actions.

Consult UX design to find the right behavior and settings for your use case and check out the rest of available properties below.

import {BottomSheet, BottomSheetFooter} from 'trinidad-ui'

<BottomSheet allowHeaderSwipe={true/false}
             headerTitle={'Title'}
             headerImageUrl={'Url to image in header'}
             headerImageAlt={'alt text for image in hader'}
             twoStepExpansion={true/false}
             behavior={'standard/modal/hybrid'}>
  <div>
    <p>Content</p>
    <p>Content</p>
  </div>
  <BottomSheetFooter>
    <p>Footer</p>
  </BottomSheetFooter>
</BottomSheet>

Properties

BottomSheet

Prop nameTypeDefault ValueDescription
allowHeaderSwipeboolfalseIf header should be swipeable - default false
behaviorenum'standard'Standard, modal or hybrid - default standard
bypassTabOrderboolfalseBypass the natural taborder. Essentially injects the sheet in the tab order that the component is placed in the DOM.
collapsedHeightunion0Collapsed height in px as int or % of the sheet - default 0 ie. 125 or '20%'
customerenum'neutral'Neutral or tur for smooth border radius, sport for sharp.
disablePageContentSpacingboolfalseIf sheet should skip to add padding to page (<footer> if present otherwise to <body>).
headerImageAltstring''Alt text for header image
headerImageUrlstring''Url for image in header.
headerTitlestring''Title for the bottom sheet.
invertedboolfalseIf sheet should be inverted.
isExpandedboolfalseIf sheet should be expanded on render.
isFixedboolfalseIf sheet should be fixed.
isVisiblebooltrueIf sheet should be visible.
positionenum'bottom'Sets position of Sheet. Notice that any other position then bottom will automatically set behavior: 'modal', customer: 'sport, isFixed:true
responsiveboolfalseSet true for responsive width when position is not bottom/top. The sheet will be with: auto between 21em and 90vw.
transparentboolfalseIf sheet should be transparent.
twoStepExpansionboolfalseIf sheet should be expanded in two steps. * note: Skips half-expanded step if difference between maxHeight and halfExpandedHeight is less than 1/3 of viewport height.
appendTonode
childrennodeChildren to render
classNamestringCustom classes
onStateChangefuncCallback function when state changes.

BottomSheetFooter

Prop nameTypeDefault ValueDescription
childrennode
classNamestringCustom class name(s) to add to the component.

Accessibility

This component has been validated to meet the WCAG 2.1 AA accessibility guidelines.

Additional information regarding accessibility of this component below.

Keep in mind that a bottom sheet is positioned last in the DOM meaning that the user needs to tab through all the content and footer of the page before entering the first focusable element in the bottom sheet

Read more about WCAG 2.1 AA.