qat

Week view

WeekView. It is copied into your app’s ui/ by qatjs add week: the code is yours to edit.

Example

Thu 22Fri 23Sat 24
All day

Nothing yet

Example.qx26 lines, 1 reactive nameOpen in the playground
import WeekView, { type WeekEvent } from './ui/week/week.qx'

const events: WeekEvent[] = [
  { id: 'brief', title: 'Courier briefing', start: '2026-10-22T09:00', end: '2026-10-22T10:30', tone: 'neutral' },
  { id: 'call', title: 'Supplier call', start: '2026-10-23T10:00', end: '2026-10-23T11:00' },
  { id: 'stock', title: 'Stocktake', start: '2026-10-23', allDay: true },
]

export default function Example() {
  let made = state('')
  return (
    <WeekView
      label="Deliveries"
      start="2026-10-22"
      days={3}
      hours={[8, 18]}
      events={events}
      now="2026-10-23T12:00"
      locale="en-GB"
      height={288}
      on:create={(e) => (made = `new ${e.start}–${e.end.slice(11)}`)}
      on:open={(id) => (made = `opened ${id}`)}
    />
    <p>{made || 'Nothing yet'}</p>
  )
}
made state

Add it

shell1 line
npx qatjs add week

WeekView

As a custom element: <ui-week-view>.

WeekView: props
PropTypeAttribute
labelstringyes
startstringyes
daysnumberyes
hours[number, number]property only
eventsWeekEvent[]property only
nowstringyes
localestringyes
heightnumberyes
WeekView: events
EventDetail
on:openCustomEvent<string>
on:createCustomEvent<{ start: string; end: string }>

Keys

KeyDoes
Tabto an event, to a day’s “New event”
Enteropen, create