Bottom bar that hides on scroll
A sticky buy bar at thumb height. It slides away while you scroll down to read and comes back the moment you scroll up.
Mobile onlyNew
Install
npx finepieces add hiding-bottom-barOr with the shadcn CLI ›
npx shadcn@latest add https://finepieces.net/r/hiding-bottom-bar.jsonScroll the phone down, then up
example.tsx
import { HidingBottomBar } from "@/components/fine-pieces/hiding-bottom-bar";
export default function Example() {
return (
<Phone bg="#E9EDE4">
<HidingBottomBar price="€34" note="incl. delivery">
<header className="sticky top-0 z-[2] flex items-center justify-between bg-[#FBFAF6]/90 px-[18px] pb-2.5 pt-11 backdrop-blur-[10px]">
<b className="font-display text-[17px] font-bold tracking-[-.03em]">Fleur & Zo</b>
<span className="text-[12px] font-medium">Bag</span>
</header>
<img src={"/images/bloem-1.webp"} alt="" className="aspect-[4/5] w-full object-cover" />
{[
["Spring bouquet", "Ranunculus, tulips and a little eucalyptus, tied by hand on the morning we deliver.", "bloem-3"],
["Lasts a week", "Cut the stems at an angle and change the water every two days.", "plant-2"],
["Delivered Friday", "Order before Thursday 18:00. Free delivery in Utrecht.", ""],
].map(([h, p, k], i) => (
<div key={h}>
<div className="px-[18px] pb-[26px] pt-[18px]">
<h3 className={i === 0 ? "mb-2.5 font-display text-[30px] font-bold leading-none tracking-[-.045em]" : "mb-1.5 text-[16px] font-semibold tracking-[-.02em]"}>{h}</h3>
<p className="text-[13.5px] leading-[1.45] text-muted-foreground">{p}</p>
</div>
{k && <img src={img(k)} alt="" className="aspect-[4/5] w-full object-cover" />}
</div>
))}
</HidingBottomBar>
</Phone>
);
}