business-hours-widget
v0.1.0
Published
An animated business hours widget for React. Timezone-aware, zero dependencies.
Maintainers
Readme
business-hours-widget
An animated business hours widget for React. Shows open/closed status, a live analog clock in the business timezone, and an expandable weekly schedule.
Zero dependencies. TypeScript. React 18+.
Installation
npm install business-hours-widgetUsage
import { BusinessHours } from 'business-hours-widget'
<BusinessHours
name="Carril Agency"
timezone="America/New_York"
schedule={{
monday: { open: "09:00", close: "18:00" },
tuesday: { open: "09:00", close: "18:00" },
wednesday: { open: "09:00", close: "18:00" },
thursday: { open: "09:00", close: "18:00" },
friday: { open: "09:00", close: "17:00" },
saturday: { open: "10:00", close: "14:00" },
sunday: { closed: true },
}}
/>Props
| Prop | Type | Required | Description |
|------|------|----------|-------------|
| name | string | Yes | Business name shown in the header |
| timezone | string | Yes | IANA timezone (e.g. "America/New_York") |
| schedule | BusinessHoursSchedule | Yes | Weekly schedule object |
DaySchedule
| Field | Type | Description |
|-------|------|-------------|
| open | string | Opening time in 24h format ("09:00") |
| close | string | Closing time in 24h format ("18:00") |
| closed | boolean | Set to true for days the business is closed |
License
MIT
