Event Feed
NewInstallation
npx shadcn@latest add https://uibrik.com/r/event-feed.jsonInstall the packages
npm install motionAdd the cn helper
Imports
cnfrom@/lib/utils, whichshadcn initcreates. Add it by hand without shadcn.Copy the source into your project
components/uibrik/event-feed/event-feed.tsx"use client"; // A live feed card: every few seconds a new event drops in at the top with a // brief highlight, the rest slide down, and the oldest fades out past the // bottom edge. Times count up as they age. It only runs while on screen; // reduced motion shows a still list. import { AnimatePresence, motion, useInView, useReducedMotion } from "motion/react"; import { useEffect, useRef, useState } from "react"; import { cn } from "@/lib/utils"; const EASE_OUT: [number, number, number, number] = [0.23, 1, 0.32, 1]; const SPRING = { type: "spring", duration: 0.5, bounce: 0 } as const; const ROW = 60; export type FeedEvent = { /** Who or what, e.g. a customer name. */ title: string; /** Second line, e.g. the plan or source. */ detail?: string; /** Right-hand value, e.g. an amount. */ value?: string; };
Adds the files to
components/uibrik/event-feed and installs motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/event-feed.Props
EventFeed- title
- Type string
- "Payments"
- Header title.
- interval
- Type number
- 2.4
- Seconds between new events.
- visible
- Type number
- 4
- Rows on show.
- events
- Type { title: string; detail?: string; value?: string }[]
- 7 payments
- Events to cycle through, in order.
- className
- Type string
- –
- Classes for the card.