Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

Notch for Astro

Set a label or action into the corner of a card or image. The notch fits its content.

A small silver robot with black oval eyes on a pale blue background.
New

Pocket Robot

A palm-sized 3D robot companion for your sci-fi game.
$12

Installation

bunx --bun shadcn@latest add @gnostic/notch

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.

Winter on Orion
A traveler crosses a snowy plain toward a mountain beneath a pink sun. View full image

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

PropType
corner?'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'

Corner of the positioned parent that holds the slot content.

Type'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
Default"top-left"

Read the installed source for the complete component.