FloatingBar

A companion bar that floats above the sheet and follows it during drag. It automatically fades and slides away as the sheet expands.

Basic usage

Place FloatingBar as a sibling of Content inside the Portal. It automatically positions itself above the sheet.

<BottomSheet.Root open={open} onOpenChange={setOpen}>
  <BottomSheet.Portal>
    <BottomSheet.Overlay />
    <BottomSheet.Content>
      <BottomSheet.Handle />
      {/* Sheet content */}
    </BottomSheet.Content>

    <BottomSheet.FloatingBar gap={12}>
      <div className="flex gap-2">
        <button>Favorite</button>
        <button>Share</button>
        <button>Save</button>
      </div>
    </BottomSheet.FloatingBar>
  </BottomSheet.Portal>
</BottomSheet.Root>

Props

<BottomSheet.FloatingBar
  gap={16}                // space above the sheet (px)
  hideWhileDragging       // hide during drag
  fadeStartPercent={50}   // start fading at 50% viewport
  fadeEndPercent={65}     // fully faded at 65% viewport
>
  {/* Actions */}
</BottomSheet.FloatingBar>
PropTypeDefaultDescription
gapnumber16Space between bar and sheet (px)
hideWhileDraggingbooleanfalseHide during drag interaction
fadeStartPercentnumber50Viewport % to start fade
fadeEndPercentnumber65Viewport % to finish fade

Use cases

  • Action buttons (favorite, share, save) for a detail sheet
  • A search bar above a results sheet
  • Navigation controls for a map sheet