Skip to content

Calendar

A date picker calendar component for selecting dates.

Selected: No date selected

September 2026
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
Event Date, September 2026

Installation

bash
npx @galaxy-stack/nebula-cli add calendar
bash
npx @galaxy-stack/nebula-cli add calendar
bash
npx @galaxy-stack/nebula-cli add calendar
bash
# If you have installed galaxy-design globally
galaxy-design add calendar

Usage

tsx
import { Calendar } from '@/components/calendar'
import { useState } from 'react'

export default function CalendarDemo() {
  const [date, setDate] = useState<Date | undefined>(new Date())

  return (
    <Calendar
      mode="single"
      selected={date}
      onSelect={setDate}
      className="rounded-md border"
    />
  )
}
vue
<script setup lang="ts">
import { ref } from 'vue'
import { Calendar } from '@/components/calendar'

const date = ref<Date>(new Date())
</script>

<template>
  <Calendar
    v-model="date"
    class="rounded-md border"
  />
</template>
typescript
import { Component } from '@angular/core'
import { CalendarComponent } from '@/components/calendar'

@Component({
  selector: 'app-calendar-demo',
  standalone: true,
  imports: [CalendarComponent],
  template: `
    <ui-calendar
      [selectedDate]="date"
      (dateChange)="handleDateChange($event)"
      class="rounded-md border"
    />
  `
})
export class CalendarDemo {
  date = new Date()

  handleDateChange(newDate: Date) {
    this.date = newDate
  }
}

API Reference

Props

This component accepts the following props:

PropTypeDefaultDescription
............

Props

PropTypeDefaultDescription
selectedDate | undefined-The selected date
onSelect(date: Date | undefined) => void-Callback when date is selected
disabledDate[] | ((date: Date) => boolean)-Dates that should be disabled
classNamestring-Additional CSS classes

Examples

With Date Range

tsx
<Calendar
  mode="range"
  selected={dateRange}
  onSelect={setDateRange}
  numberOfMonths={2}
  className="rounded-md border"
/>

Disabled Dates

tsx
const disabledDays = [
  new Date(2024, 0, 1),
  new Date(2024, 0, 15),
]

<Calendar
  mode="single"
  selected={date}
  onSelect={setDate}
  disabled={disabledDays}
/>

Accessibility

  • Keyboard navigation with arrow keys
  • Proper ARIA labels for days and navigation
  • Focus management for keyboard users

Author

Bùi Trọng Hiếu (kevinbui)

License

MIT © 2025 Bùi Trọng Hiếu (kevinbui)

Released under the MIT License.