Skip to main content
Version: 1.0.2

Pin

Overview

The Pin component makes absolute positioning declarative.
It lets you "pin" elements like close buttons, badges, or floating actions to a corner or edge of their nearest relative container.

Preview

Pinned button inside a card

Installation

npx @mindfiredigital/ignix-ui add pin

Usage

import Pin from './components/ui';

function BasicPin() {
return (
<div className="relative">
<Pin to="bottom-right" offset="large">
<button className="bg-blue-600 text-white p-2 rounded-full">+</button>
</Pin>
</div>
);
}

Variants

Pinned button inside a card

Props

PropTypeDefaultDescription
to"top-left" | "top-right" | "bottom-left" | "bottom-right""top-right"Position of the pinned element.
offset"none" | "small" | "normal" | "large" | "xl""normal"Spacing offset from edges.
zIndex"low" | "normal" | "high" | number"normal"Z-index control (preset or custom number).
mobile"relative" | "absolute"undefinedOverride positioning behavior on mobile.
asReact.ElementType"div"Custom wrapper element (e.g., span, button).
childrenReactNodeElement(s) to pin.

⚠️ Note: Parent container must have position: relative for <Pin> to work properly.