Effects Fancy Stable

DimSiblings

Wraps a group of cards, links, or list items so hovering or keyboard-focusing one dims (or blurs) every other one — a pure CSS :has() affordance with zero pointer-tracking JavaScript

Preview

Installation

pnpm add fancy-ui-svelte
import { DimSiblings } from 'fancy-ui-svelte'

Usage

svelte
<script lang="ts">
  import { DimSiblings } from 'fancy-ui-svelte';
</script>

<DimSiblings />

Examples

Basic Usage

With Blur

Blur non-active siblings in addition to dimming them.

Props

PropTypeDefaultDescription
effect "dim" | "blur" | "both""dim"Which visual property the non-active siblings lose
opacity number0.4Opacity the non-active siblings settle to — a floor, not zero
blur number2Blur radius in px, applied only when effect includes blur
duration number150Transition duration in ms for the opacity/blur change
as keyof HTMLElementTagNameMap"div"The rendered root element — "ul"/"ol" for a list whose CSS list semantics need to survive the wrapper
class string-Additional CSS classes
ref HTMLElement | nullnullBindable reference to the root element

Slots

SlotDescription
childrenThe sibling group — every direct child participates