uibrik

Magnetic FAQ

Preview

Customize

Strength14px
Radius180px
Scatter48px
Card width420px

Usage

import { MagneticFaq } from "@/components/uibrik/magnetic-faq/magnetic-faq";

<MagneticFaq items={items} />

Installation

npx shadcn@latest add https://uibrik.com/r/magnetic-faq.json
Adds the files to components/uibrik/magnetic-faq and installs @tabler/icons-react and motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/magnetic-faq.

Props

MagneticFaq
strength
Type number
14
Furthest a pill moves toward the pointer.
radius
Type number
180
Distance from the pointer within which pills are pulled.
scatter
Type number
48
How far the other pills drift out while a card is open.
depth
Type boolean
true
Further pills are fainter and move less.
trail
Type boolean
true
Leave a dashed outline where the open card's pill sits.
cardWidth
Type number
420
Width of the open card; it never grows past the cloud.
itemsrequired
Type { question: string; answer: string; related?: number[] }[]
–
Questions and their answers. Keep questions short; they sit on one line. related lists the indexes kept sharp and clickable while this one is open.
className
Type string
–
Classes for the wrapper.