Auto-Advance Card
An accent card that auto-advances through short stories with segmented progress bars that pause on hover and focus and double as tabs.
npx shadcn@latest add https://ui.develop-better-solutions.com/r/auto-advance-card.jsonUses:carousel-hooks
Flu season clinic hours
Walk-in vaccination is open every weekday from 08:00 to 12:00 at the east wing until the end of December.
Usage
auto-advance-card-example.tsx
"use client";
import { AutoAdvanceCard } from "@dbs/ui";
const ITEMS = [
{ id: "1", title: "Flu season clinic hours", body: "Walk-in vaccination is open every weekday from 08:00 to 12:00 at the east wing until the end of December." },
{ id: "2", title: "New booking flow", body: "Book, reschedule and cancel appointments from one place, and get a reminder the day before." },
{ id: "3", title: "Your reports are ready", body: "Lab results from the last visit are now in your health report, reviewed by your doctor." },
];
export default function AutoAdvanceCardExample() {
return (
<div className="w-full max-w-sm" style={{ "--ui-accent": "#2563eb", "--ui-on-accent": "#fff" } as React.CSSProperties}>
<AutoAdvanceCard
label="News from the doctor"
items={ITEMS}
intervalMs={5000}
icon={<span className="flex h-11 w-11 items-center justify-center rounded-full bg-white"><span className="h-5 w-5 rounded-full bg-[#2563eb]" /></span>}
renderAction={() => (
<button type="button" className="inline-flex h-9 items-center rounded-full bg-white px-4 text-[13px] font-semibold text-[#2563eb]">Today's info</button>
)}
/>
</div>
);
}