Skip to content

Early previewhamur is not on npm yet. The components are being built in the open, follow along on GitHub.

UIComponentsReact

Week Picker

A button that shows the chosen week and opens a week calendar in a popup to pick it from.

Built on the headless Week Picker.See its API in Docs

Rendered by React 19.3.1

week-picker.tsx

Installation

npx shadcn@4.23.0 add https://hamur.dev/r/react/week-picker.json

It also adds utils, button, popover, week-calendar. The app needs its setup first: Installation.

Usage

WeekPicker holds a WeekPickerTrigger and a WeekPickerPortal with a WeekPickerPositioner, a WeekPickerPopup and a WeekPickerCalendar. The Trigger draws lucide's CalendarDays and a WeekPickerValue, which shows the chosen week ("Week 46, Nov 8 – 14, 2026") or the placeholder; give the Trigger children of your own to replace the Value. The Calendar draws the Week Calendar's content unless it has children, and WeekPickerClose closes the popup. Name the picker with a Field label or aria-label on the Trigger. The value, the week rule, the limits, closeOnSelect and the popup state are the headless Week Picker's Root props.

import {
  WeekPicker,
  WeekPickerCalendar,
  WeekPickerClose,
  WeekPickerPopup,
  WeekPickerPortal,
  WeekPickerPositioner,
  WeekPickerTrigger,
  WeekPickerValue,
} from '@/components/ui/week-picker'

Examples

Default

A picker in a Field with the current week chosen.

Its preview and code are at the top of the page.

It follows shadcn's date picker page: an outline button, w-64 and aligned to the start, that opens a Popover's content with w-auto p-0 around the calendar, aligned to the button's start. The placeholder is the muted text the Date Picker uses. Opening moves focus to the chosen week, or today's; a pressed week closes the popup and focus returns to the Trigger. This item takes Base UI's component ID as its slug and one name per Base UI part.

API reference

The styled parts pass every prop to the headless part they wrap and add classes. The props, data attributes and keyboard are on Week Picker's API reference.