API & PlaygroundVanillaBottomSheetCoreCommands

Commands

  • mount(mountingPoint?: Element): void
    Mounts the bottom sheet to the DOM or to a provided mounting point. If no mounting point is specified, it defaults to appending to the body.

  • unmount(): void
    Removes the bottom sheet from the DOM, effectively cleaning up all associated elements and event listeners.

  • open(): void
    Opens the bottom sheet, making it visible on the screen.

  • close(): void
    Closes the bottom sheet, making it invisible on the screen.

  • moveTo(endY: number): void
    Moves the bottom sheet to a specified vertical position within the viewport. The top of the viewport is 0, increasing towards the bottom.

  • snapTo(percent: number): void
    Moves the bottom sheet to a relative position within the viewport based on percentage. For example, 0.1 would position the bottom sheet 10% below the top of the viewport.

;