Skip to content
caliper ui docs

Pro

Scroll aware fab

The main action kept in reach: it shows its label at the top and when scrolling up, and shrinks to its icon while you scroll down.

Pro
pnpm dlx shadcn@latest add @caliper/scroll-aware-fab

Messages

  • Amara OkaforCan you approve INV-2041 today?
  • Tomás FerreiraNotes from the Ostra call are in the doc.
  • Priya RamanBank feed is back, 12 payments matched.
  • Kiara MurayamaWelcome Noor to the team on Monday?
  • Rafael AbreuSeptember is closed. Thanks all!
  • Amara OkaforLedger export is in the shared folder.
  • Tomás FerreiraI changed the travel rule to €400.
  • Priya RamanCan you approve INV-2041 today?
  • Kiara MurayamaNotes from the Ostra call are in the doc.
  • Rafael AbreuBank feed is back, 12 payments matched.
  • Amara OkaforWelcome Noor to the team on Monday?
  • Tomás FerreiraSeptember is closed. Thanks all!
  • Priya RamanLedger export is in the shared folder.
  • Kiara MurayamaI changed the travel rule to €400.
  • Rafael AbreuCan you approve INV-2041 today?
  • Amara OkaforNotes from the Ostra call are in the doc.
  • Tomás FerreiraBank feed is back, 12 payments matched.
  • Priya RamanWelcome Noor to the team on Monday?
  • Kiara MurayamaSeptember is closed. Thanks all!
  • Rafael AbreuLedger export is in the shared folder.
  • Amara OkaforI changed the travel rule to €400.
  • Tomás FerreiraCan you approve INV-2041 today?
  • Priya RamanNotes from the Ostra call are in the doc.
  • Kiara MurayamaBank feed is back, 12 payments matched.
Installs components/ui/scroll-aware-fab.tsxDepends on none beyond ReactMotion none in component source

When to use

Use it for

  • Phone screens with one primary action, like compose.
  • Long lists where the action should not cover content.

Skip it when

  • Desktop layouts; put the action in the header.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/scroll-aware-fab

Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

Usage

Import it from your copy of the source. The example behind the preview comes with the source.

example.tsx
import { ScrollAwareFab } from "@/components/ui/scroll-aware-fab"

The worked example comes with Pro

The 33-line example behind the preview opens here, ready to copy.

  • 626 Pro parts, blocks and page templates, all with source
  • $149 once, with lifetime updates. No renewal
  • A full refund within 14 days if it is not for you
Checking your licence…

API reference

ScrollAwareFab

component

Also accepts the native props of its root element and a ref.

PropTypeDefaultDescription
icon *ReactNode—
label *string—What it does, e.g. "New message". Always its accessible name.
scrollRootRefObject<HTMLElement | null>—The element that scrolls, if not the window.
position"fixed" | "absolute""fixed""absolute" places it in its nearest positioned parent, e.g. a phone frame.

Accessibility

It is built on native elements and keeps aria-label and aria-hidden in step with state.

No custom key handling; Tab and the native activation keys do the work.

Motion

It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.

All Surfaces examples