Veil UI
Components

Bottom Sheet

A mobile-style sheet anchored to the bottom of the viewport with a drag handle.

Installation

$ npx veil-ui@latest add bottom-sheet

Usage

import {
  BottomSheet,
  BottomSheetContent,
  BottomSheetDescription,
  BottomSheetHeader,
  BottomSheetTitle,
  BottomSheetTrigger,
} from "@/components/ui/bottom-sheet";

<BottomSheet>
  <BottomSheetTrigger asChild>
    <button type="button">Open actions</button>
  </BottomSheetTrigger>
  <BottomSheetContent>
    <BottomSheetHeader>
      <BottomSheetTitle>Quick actions</BottomSheetTitle>
      <BottomSheetDescription>Choose what to do next.</BottomSheetDescription>
    </BottomSheetHeader>
  </BottomSheetContent>
</BottomSheet>;

Examples

Actions

Form

API reference

  • BottomSheetContent renders a bottom-anchored rounded panel with a decorative drag handle.
  • All Radix Dialog parts are exported with BottomSheet prefixes.
  • showCloseButton hides the built-in close button.

Accessibility

  • Dialog semantics and focus trapping come from Radix.
  • The drag handle is decorative and hidden from assistive technology.
  • The close button is labelled Close bottom sheet.

Vue and plain HTML

This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add bottom-sheet --framework vue or switch the framework in components.json.

<script setup lang="ts">
import { DialogClose, DialogContent, DialogPortal } from "reka-ui";
import { X } from "lucide-vue-next";

import { cn } from "@/lib/utils";

import BottomSheetOverlay from "./BottomSheetOverlay.vue";

const props = defineProps<{ class?: string }>();
</script>

<template>
  <DialogPortal>
    <BottomSheetOverlay />
    <DialogContent
      data-slot="bottom-sheet-content"
      :class="
        cn(
          'fixed inset-x-0 bottom-0 z-50 flex max-h-[85vh] flex-col gap-4 overflow-y-auto rounded-t-xl border-t bg-background px-6 pb-6 pt-3 shadow-lg outline-none',
          'data-[state=open]:animate-in data-[state=closed]:animate-out [--veil-animation-duration:300ms] [--veil-exit-duration:200ms]',
          'data-[state=open]:slide-in-from-bottom-full data-[state=closed]:slide-out-to-bottom-full',
          props.class,
        )
      "
    >
      <div
        aria-hidden="true"
        class="mx-auto h-1.5 w-10 shrink-0 rounded-full bg-muted"
      />
      <slot />
      <DialogClose
        data-slot="bottom-sheet-close"
        aria-label="Close bottom sheet"
        class="absolute right-4 top-4 rounded-sm p-1 text-muted-foreground opacity-70 outline-none transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring"
      >
        <X class="size-4" aria-hidden="true" />
      </DialogClose>
    </DialogContent>
  </DialogPortal>
</template>

On this page