Delivery Slot Picker
Two linked radio groups for booking a delivery: day tiles with weekday over date, and time-window pills.
npx shadcn@latest add https://ui.develop-better-solutions.com/r/delivery-slot-picker.jsonChoose a day
Choose a two hour window
Your order travels at 4 degrees in an insulated crate.
Usage
delivery-slot-picker-example.tsx
"use client";
import { useState } from "react";
import { DeliverySlotPicker } from "@dbs/ui";
const DAYS = [
{ id: "mon", weekday: "Mon", day: "17" },
{ id: "tue", weekday: "Tue", day: "18" },
{ id: "wed", weekday: "Wed", day: "19" },
{ id: "thu", weekday: "Thu", day: "20" },
{ id: "fri", weekday: "Fri", day: "21", disabled: true },
{ id: "sat", weekday: "Sat", day: "22" },
];
const WINDOWS = ["08:00 to 10:00", "10:00 to 12:00", "14:00 to 16:00", "16:00 to 18:00"];
export default function DeliverySlotPickerExample() {
const [day, setDay] = useState("tue");
const [win, setWin] = useState(WINDOWS[1] ?? "");
return (
<div className="w-full max-w-xl rounded-2xl border border-line p-6">
<DeliverySlotPicker
days={DAYS}
windows={WINDOWS}
dayId={day}
windowValue={win}
onDayChange={setDay}
onWindowChange={setWin}
note="Your order travels at 4 degrees in an insulated crate."
/>
</div>
);
}