Notch
A tab that hangs from the top edge with curved shoulders, dropping in once on mount.
Behaviour
- Hangs from the top edge of the nearest relative container; the shoulders curve into that edge.
- Drops in 26px and fades up once on mount.
- The tab is at most 200px wide on phones and 500px from md up.
- Reduced motion: it fades in without moving.
Props
| Prop | Type | Description |
|---|---|---|
| children | ReactNode | What sits in the tab: a logo, a wordmark, a nav. |
| color | stringdefault "#fff" | Fill of the tab and of its two shoulders. Any CSS colour. |
| radius | numberdefault 32 | Radius of the lower corners and size of the shoulders, in px. |
| delay | numberdefault 1.05 | Seconds before the tab drops in. |
| offset | numberdefault 0 | Gap in px between the container's top edge and the tab. |
| className | string | Classes for the positioning wrapper (absolute, full width). |
Installation
npx shadcn@latest add https://purrfectui.com/r/notch.jsonHow to use
import { Notch } from "@/components/ui/notch";
<div className="relative h-64 overflow-hidden rounded-3xl">
<Notch>
<span className="text-2xl font-medium">ARMOUR</span>
</Notch>
</div>Source code
Loading…
Credits
Ported from armour.vaibhavtomar.com.
License
MIT. Copy it into your project and change it as you like.