Notch for Astro
Set a label or action into the corner of a card or image. The notch fits its content.
Installation
bunx --bun shadcn@latest add @gnostic/notchnpx shadcn@latest add @gnostic/notchpnpm dlx shadcn@latest add @gnostic/notchCopy the files
src/components/ui/notch/notch.astrosrc/components/ui/notch/index.tssrc/components/ui/notch/types.ts
Usage
---
import { Card } from "@/components/ui/card"
import { Notch } from "@/components/ui/notch"
---
<Card as="article" class="rounded-2xl p-6 pt-12">
<Notch class="text-sm font-medium">Featured</Notch>
<h3>Project brief</h3>
</Card>
Put Notch inside a positioned parent. Card already has position: relative. For an image, put the image and its notches in a wrapper with class="relative rounded-2xl". Set rounded-[inherit] on the image. Leave overflow visible on the wrapper so the notch covers the image edge.
Put text, an icon, or a link in the default slot. The content and padding set the notch size. Use padding utilities to adjust the space around the content. Leave room for the notch when you place other content near the same corner.
Image with two notches
Place one Notch in each corner that needs a label or action. Both are children of the same figure.
Theme and layout
The notch uses bg-background to blend into the surrounding surface. Use bg-card for a card-colored inset or another solid background utility to match your layout. All three curves use --radius-2xl by default. For a host with rounded-xl, set [--notch-radius:var(--radius-xl)] on the host to match its radius.
API reference
corner?'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
Corner of the positioned parent that holds the slot content.
'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'"top-left"Read the installed source for the complete component.

