Skip to content

BottomSheet

The bottom-sheet component.

  • Import
    import "@tapsioss/web-components/bottom-sheet";
  • Tag
    <tapsi-bottom-sheet></tapsi-bottom-sheet>

Properties

NameDescriptionTypeDefault Value
openDetermines whether the bottom-sheet is open.booleanfalse
heading-titleSets the heading title in a declarative-way.string""
heading-descriptionSets the heading description in a declarative-way.string""
has-grabberDetermines whether the grabber should be visible or not.booleanfalse
has-dismiss-buttonDetermines whether the dismiss button should be visible or not.booleanfalse
sticky-action-barDetermines whether the action bar should be sticky or not.booleanfalse
sticky-headerDetermines whether the header should be sticky or not.booleanfalse
expandableDetermines whether the bottom sheet should be expanded by grabbing gesture.booleanfalse
variantThe variant of the bottom sheet."modal" | "inline""modal"
labelDefines a string value that can be used to set a label for assistive technologies. https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelstring""
labelledbyIdentifies the element (or elements) that labels the element. https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledbystring""
focus-targetIdentifies the element that should get focused when bottom sheet opens.string""

Slots

NameDescription
headerThe slot for the header content.
bodyThe slot for the main body content.
action-barThe slot for the action bar content.

TIP

You can use slot names as variables:

ts
import { Slots } from "@tapsioss/web-components/bottom-sheet";

console.log(Slots.HEADER); // "header"
console.log(Slots.BODY); // "body"
console.log(Slots.ACTION_BAR); // "action-bar"

Events

NameDescriptionType
snappedFired when the bottom-sheet is snapped to a specific position.SnappedEvent
openingFired when the bottom-sheet starts to open (Cancelable).OpeningEvent
closingFired when the bottom-sheet starts to close (Cancelable).ClosingEvent
openedFired when the bottom-sheet has fully opened.OpenedEvent
closedFired when the bottom-sheet has fully closed.ClosedEvent
hideFired when the bottom-sheet is hidden (Cancelable).HideEvent
showFired when the bottom-sheet is shown (Cancelable).ShowEvent

TIP

You can import custom event names:

ts
import { 
  SnappedEvent,
  OpeningEvent,
  ClosingEvent,
  OpenedEvent,
  ClosedEvent,
  HideEvent,
  ShowEvent
} from "@tapsioss/web-components/bottom-sheet";

element.addEventListener(SnappedEvent.type, handleTapsiBottomSheetSnapped);
element.addEventListener(OpeningEvent.type, handleTapsiBottomSheetOpening);
element.addEventListener(ClosingEvent.type, handleTapsiBottomSheetClosing);
element.addEventListener(OpenedEvent.type, handleTapsiBottomSheetOpened);
element.addEventListener(ClosedEvent.type, handleTapsiBottomSheetClosed);
element.addEventListener(HideEvent.type, handleTapsiBottomSheetHide);
element.addEventListener(ShowEvent.type, handleTapsiBottomSheetShow);