← All components
Sibling Dimming
HoverSibling dimming — hovering one item dims every non-hovered sibling to 50%. Pure CSS.
Overview
Pricing
Docs
Changelog
Installation
One command drops the source into your repo — editable, with the provider and motion pulled in automatically.
npx shadcn add https://motion.asmitsah.dev/r/sibling-dimming.jsonPrerequisiteInstall the provider base first
This component imports from @/lib/motion and needs <MotionProvider> mounted in your root layout — install the base once, before copying this component.
npx shadcn add https://motion.asmitsah.dev/r/provider.jsonStep 1Install the runtime dependency
npm install motionStep 2Copy the source into
components/motion/sibling-dimming.tsxcomponents/motion/sibling-dimming.tsx
Usage
Basic group
Wrap a set of items in SiblingDimming, each item in SiblingDimmingItem. Pure CSS — no JS, no state.
Nav bar
A common home — hovering a nav link dims the others so the active hover reads clearly. SiblingDimming renders the container div itself.
Feature grid
Works in a grid just as well — the :has() selector only cares about the dim-item marker, not layout.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | The SiblingDimmingItem elements to group — hovering one dims its non-hovered siblings. |
| className | string | — | Passed straight through — SiblingDimming becomes your layout element (e.g. a flex row or grid). |
| style | CSSProperties | — | Inline style passthrough. |
SiblingDimmingItem
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | The item's content. |
| className | string | — | Passed straight through — SiblingDimmingItem becomes your item element. |
| style | CSSProperties | — | Merged after the built-in opacity-transition timing, so you can override it per instance. |