Skip to content
shadcn.io
shadcn.io is not affiliated with official shadcn/ui

Shadcn Float for React and Tailwind

Anchor an element to the edge of a container.

9+

Installation

bunx --bun shadcn@latest add https://kit.dev/r/float.json

Usage

import { Float } from "@/components/ui/float";
<div className="relative">
  <Float placement="top-end">
    {/** floated content **/}
  </Float>
</div>

Placement

API Reference

Float

PropTypeDefault
placement"top-start" | "top-center" | "top-end" | "middle-start" | "middle-center" | "middle-end" | "bottom-start" | "bottom-center" | "bottom-end""top-end"
classNamestring-
asChildbooleanfalse