docs/components/float
Sections
Components
Utilities
Forms
Hooks
Copy Markdown
Anchor an element to the edge of a container.
PreviewCode
9+
CLIManual
pnpmbunnpmyarn
pnpm dlx shadcn@latest add @shark/float
import { Float } from "@/components/ui/float";
<div className="relative">
<Float placement="top-end">
{/ **floated content** /}
</Float>
</div>
PreviewCode
top-start
3
top-center
3
top-end
3
middle-start
3
middle-center
3
middle-end
3
bottom-start
3
bottom-center
3
bottom-end
3
| Prop | Type | Default |
|---|---|---|
placement | `"top-start" | "top-center" |
className | string | - |
asChild | boolean | false |
[
Previous page
File Upload ](/docs/components/file-upload)[
Next page
Floating Panel ](/docs/components/floating-panel)
On This Page