NK

Search

Search pages, posts, and components

All components

Gradient Border

Background Effects

A card wrapped in a rotating conic-gradient border.

Pro plan

Everything, unlimited.

Installation

Add it with the shadcn CLI:

$pnpm dlx shadcn@latest add https://nawalkattel.com.np/r/gradient-border.json
Or install manually
  1. 1. Install dependencies

    pnpm add motion clsx tailwind-merge
  2. 2. Copy the component source into components/library/gradient-border.tsx

Props

PropTypeDefaultDescription
childrenReactNode - Card contents.
classNamestring - Classes applied to the wrapper.

Accessibility

  • The rotating layer is decorative and sits behind the content.
  • Content keeps an opaque background, so text contrast is stable.
  • Rotation is transform-only and compositor-friendly.

Dependencies

motionclsxtailwind-merge