@dayflow/core 1.0.7 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +325 -90
- package/README.md +319 -78
- package/README.zh.md +324 -89
- package/dist/components/common/CalendarHeader.d.ts +4 -0
- package/dist/components/common/ColorPicker.d.ts +1 -0
- package/dist/components/common/DefaultEventDetailPanel.d.ts +1 -1
- package/dist/components/common/MobileEventDrawer.d.ts +12 -0
- package/dist/components/common/MobileSearchDialog.d.ts +14 -0
- package/dist/components/common/QuickCreateEventPopup.d.ts +10 -0
- package/dist/components/common/SearchDrawer.d.ts +13 -0
- package/dist/components/common/SearchResultsList.d.ts +11 -0
- package/dist/components/common/ViewHeader.d.ts +0 -2
- package/dist/components/mobileEventDrawer/DefaultMobileEventDrawer.d.ts +3 -0
- package/dist/components/mobileEventDrawer/components/Switch.d.ts +7 -0
- package/dist/components/mobileEventDrawer/components/TimePickerWheel.d.ts +7 -0
- package/dist/components/mobileEventDrawer/index.d.ts +3 -0
- package/dist/components/monthView/MultiDayEvent.d.ts +7 -2
- package/dist/components/monthView/WeekComponent.d.ts +5 -3
- package/dist/components/monthView/util.d.ts +1 -1
- package/dist/components/search/MobileSearchDialog.d.ts +14 -0
- package/dist/components/search/SearchDrawer.d.ts +13 -0
- package/dist/components/search/SearchResultsList.d.ts +11 -0
- package/dist/components/sidebar/components/CalendarList.d.ts +2 -0
- package/dist/components/sidebar/components/SidebarHeader.d.ts +0 -1
- package/dist/components/weekView/CalendarEvent.d.ts +7 -2
- package/dist/core/CalendarApp.d.ts +15 -1
- package/dist/core/DayFlowCalendar.d.ts +3 -0
- package/dist/hooks/virtualScroll/useVirtualMonthScroll.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/locale/types.d.ts +1 -1
- package/dist/styles/classNames.d.ts +9 -9
- package/dist/styles.css +464 -32
- package/dist/types/core.d.ts +38 -0
- package/dist/types/dragIndicator.d.ts +5 -3
- package/dist/types/event.d.ts +2 -0
- package/dist/types/hook.d.ts +7 -7
- package/dist/types/index.d.ts +1 -0
- package/dist/types/mobileEvent.d.ts +21 -0
- package/dist/types/monthView.d.ts +1 -0
- package/dist/types/plugin.d.ts +6 -4
- package/dist/types/search.d.ts +35 -0
- package/dist/utils/compareUtils.d.ts +5 -0
- package/dist/utils/eventUtils.d.ts +7 -0
- package/dist/utils/helpers.d.ts +2 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/searchUtils.d.ts +35 -0
- package/dist/views/MonthView.d.ts +0 -2
- package/dist/views/WeekView.d.ts +0 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# DayFlow
|
|
2
2
|
|
|
3
|
-
**English** | [中文](README.zh.md) | [日本語](README.ja.md)
|
|
3
|
+
**English** | [中文](README.zh.md) | [日本語](README.ja.md) | [Getting Started & Contributing](CONTRIBUTING.md)
|
|
4
4
|
|
|
5
|
-
A flexible and feature-rich calendar component library for React applications with drag-and-drop support, multiple
|
|
5
|
+
A flexible and feature-rich calendar component library for React applications with drag-and-drop support, multiple
|
|
6
|
+
views, and plugin architecture.
|
|
6
7
|
|
|
7
8
|
[](https://www.npmjs.com/package/@dayflow/core)
|
|
8
9
|
[](https://github.com/dayflow-js/dayflow/pulls)
|
|
@@ -14,135 +15,375 @@ A flexible and feature-rich calendar component library for React applications wi
|
|
|
14
15
|
### ✨ Monthly, Weekly, Daily and Various View Types
|
|
15
16
|
|
|
16
17
|
| Monthly | Weekly |
|
|
17
|
-
|
|
18
|
+
|------------------------------------------|----------------------------------------|
|
|
18
19
|
|  |  |
|
|
19
20
|
|
|
20
21
|
| Daily | Event Stack Level |
|
|
21
|
-
|
|
22
|
+
|---------------------------------------|------------------------------------------|
|
|
22
23
|
|  |  |
|
|
23
24
|
|
|
24
25
|
### 🤩 Default Panel (with multiple Event Detail Panel options available)
|
|
25
26
|
|
|
26
27
|
| Detail Popup | Detail Dialog |
|
|
27
|
-
|
|
28
|
+
|-------------------------------------|--------------------------------------|
|
|
28
29
|
|  |  |
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
## Quick Start
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
Official website:
|
|
33
34
|
|
|
34
|
-
https://github.
|
|
35
|
+
https://dayflow-js.github.io/calendar/
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
### Installation
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
```tsx
|
|
40
|
+
npm
|
|
41
|
+
install
|
|
42
|
+
@dayflow/
|
|
43
|
+
core
|
|
44
|
+
lucide - react
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The entire **DayFlow** app is created through the `useCalendarApp` hook, which returns a **`calendar`** object.
|
|
49
|
+
|
|
50
|
+
This object is then rendered using the `DayFlowCalendar` UI component.
|
|
39
51
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
```tsx
|
|
53
|
+
'use client';
|
|
54
|
+
|
|
55
|
+
import {
|
|
56
|
+
useCalendarApp,
|
|
57
|
+
DayFlowCalendar,
|
|
58
|
+
createMonthView,
|
|
59
|
+
createEvent,
|
|
60
|
+
createAllDayEvent,
|
|
61
|
+
createTimedEvent,
|
|
62
|
+
} from '@dayflow/core';
|
|
63
|
+
import '@dayflow/core/dist/styles.css';
|
|
64
|
+
|
|
65
|
+
// Local timed event (no timezone complexity)
|
|
66
|
+
const meeting = createEvent({
|
|
67
|
+
id: '1',
|
|
68
|
+
title: 'Team Meeting',
|
|
69
|
+
start: new Date(2024, 9, 15, 10, 0), // Oct 15, 2024 10:00
|
|
70
|
+
end: new Date(2024, 9, 15, 11, 0), // Oct 15, 2024 11:00
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// All-day event
|
|
74
|
+
const holiday = createAllDayEvent(
|
|
75
|
+
'2',
|
|
76
|
+
'Tech Conference',
|
|
77
|
+
new Date(2024, 9, 20)
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
// Quick timed event creation
|
|
81
|
+
const lunch = createTimedEvent(
|
|
82
|
+
'3',
|
|
83
|
+
'Lunch Break',
|
|
84
|
+
new Date(2024, 9, 15, 12, 0), // 12:00
|
|
85
|
+
new Date(2024, 9, 15, 13, 0) // 13:00
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
export default function MyCalendar() {
|
|
89
|
+
const calendar = useCalendarApp({
|
|
90
|
+
views: [createMonthView()],
|
|
91
|
+
events: [],
|
|
92
|
+
calendars: [],
|
|
93
|
+
defaultView: 'month',
|
|
94
|
+
initialDate: new Date(),
|
|
95
|
+
});
|
|
49
96
|
|
|
50
|
-
|
|
97
|
+
return <DayFlowCalendar calendar={calendar} />;
|
|
98
|
+
}
|
|
99
|
+
```
|
|
51
100
|
|
|
52
|
-
|
|
101
|
+
- **views**: An array of calendar views. Currently, DayFlow provides four built-in factory functions:
|
|
102
|
+
`createMonthView`, `createWeekView`, `createDayView`, and `createYearView` (still in development).
|
|
103
|
+
The order of views determines the order of tabs (Year / Month / Week / Day).
|
|
104
|
+
- **events**: The core data of the calendar. Events can be created using the built-in helpers
|
|
105
|
+
`createEvent`, `createAllDayEvent`, and `createTimedEvent`, depending on the event type.
|
|
53
106
|
|
|
54
|
-
|
|
55
|
-
- **All-Day Events**: Support for full-day events with dedicated header section
|
|
56
|
-
- **Event Stacking**: Intelligent event overlap detection with customizable stack levels
|
|
57
|
-
- **Sidebar Support**: Built-in sidebar component for calendar management
|
|
107
|
+
---
|
|
58
108
|
|
|
59
|
-
|
|
109
|
+
## `useCalendarApp` Configuration Options
|
|
60
110
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
111
|
+
| Option | Type | Default | Description | Required |
|
|
112
|
+
|------------------------|---------------------------|------------------------|----------------------------------------------------------------------------------------------------------------------|----------|
|
|
113
|
+
| `views` | `CalendarView[]` | — | Registered view definitions (e.g. `createMonthView()`). At least one view is required | ✅ |
|
|
114
|
+
| `plugins` | `CalendarPlugin[]` | `[]` | Optional plugins (drag support, keyboard shortcuts, etc.). Each plugin receives the app instance during installation | ❌ |
|
|
115
|
+
| `events` | `Event[]` | `[]` | Initial event data. Use `addEvent` / `updateEvent` to modify later | ❌ |
|
|
116
|
+
| `callbacks` | `CalendarCallbacks` | `{}` | Lifecycle hooks triggered on view, date, or event changes — ideal for API synchronization | ❌ |
|
|
117
|
+
| `defaultView` | `ViewType` | `ViewType.WEEK` | Initial view on load; must exist in `views` | ❌ |
|
|
118
|
+
| `initialDate` | `Date` | `new Date()` | Initial focused date (also initializes visible range calculation) | ❌ |
|
|
119
|
+
| `switcherMode` | `'buttons' | 'select'` | `'buttons'` | Controls how the built-in view switcher is rendered in the header | ❌ |
|
|
120
|
+
| `calendars` | `CalendarType[]` | `[]` | Register calendar categories (work, personal, etc.) with colors and visibility | ❌ |
|
|
121
|
+
| `defaultCalendar` | `string` | First visible calendar | Calendar ID used when creating new events | ❌ |
|
|
122
|
+
| `theme` | `ThemeConfig` | `{ mode: 'light' }` | Global theme mode and optional token overrides | ❌ |
|
|
123
|
+
| `locale` | `string | Locale` | `'en-US'` | Internationalization (i18n). Supports language codes (e.g. `'zh'`) or Locale objects | ❌ |
|
|
124
|
+
| `useSidebar` | `boolean | SidebarConfig` | `false` | Enable the built-in sidebar or customize width, collapse state, and renderer | ❌ |
|
|
125
|
+
| `useEventDetailDialog` | `boolean` | `false` | Use a modal dialog for event details instead of an inline panel | ❌ |
|
|
66
126
|
|
|
67
|
-
|
|
127
|
+
## Callback Functions
|
|
68
128
|
|
|
69
|
-
|
|
70
|
-
- **Click Events**: Handle event clicks with custom callbacks
|
|
71
|
-
- **Drag & Drop**: Resize and move events with visual feedback
|
|
72
|
-
- **Color Picker**: Built-in color selection component for calendar types
|
|
129
|
+
`callbacks` act as a bridge between DayFlow and your backend or external state management.
|
|
73
130
|
|
|
74
|
-
|
|
131
|
+
They are commonly used for CRUD operations with databases or APIs.
|
|
75
132
|
|
|
76
|
-
|
|
77
|
-
- **TypeScript First**: Complete type definitions for all APIs
|
|
78
|
-
- **Plugin System**: Extensible architecture with Events Plugin and Drag Plugin
|
|
79
|
-
- **Temporal API**: Modern date/time handling with Temporal polyfill
|
|
133
|
+
Examples include:
|
|
80
134
|
|
|
81
|
-
|
|
135
|
+
- `onViewChange(view)`: Triggered after view switching (useful for analytics or URL sync)
|
|
136
|
+
- `onDateChange(date)`: Fired when the focused date changes
|
|
137
|
+
- `onVisibleMonthChange(date)`: Triggered when the visible month changes (useful for preloading data)
|
|
138
|
+
- `onEventCreate / Update / Delete`: Connect event CRUD with your backend
|
|
139
|
+
- `onCalendarCreate / Update / Delete`: Sync calendar list changes
|
|
140
|
+
- `onCalendarMerge(sourceId, targetId)`: Triggered when merging two calendars
|
|
141
|
+
- `onRender`: Fired after a render cycle, suitable for performance monitoring
|
|
82
142
|
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
143
|
+
```tsx
|
|
144
|
+
const calendar = useCalendarApp({
|
|
145
|
+
views: [createDayView(), createWeekView(), createMonthView()],
|
|
146
|
+
events,
|
|
147
|
+
calendars: customCalendarTypes,
|
|
148
|
+
defaultCalendar: 'work',
|
|
149
|
+
plugins: [dragPlugin],
|
|
150
|
+
theme: { mode: 'auto' },
|
|
151
|
+
useSidebar: sidebarConfig,
|
|
152
|
+
callbacks: {
|
|
153
|
+
onCalendarUpdate: async calendar => {
|
|
154
|
+
console.log('update calendar:', calendar);
|
|
155
|
+
},
|
|
156
|
+
onCalendarDelete: async calendar => {
|
|
157
|
+
console.log('delete calendar:', calendar);
|
|
158
|
+
},
|
|
159
|
+
onCalendarCreate: async calendar => {
|
|
160
|
+
// await server API call
|
|
161
|
+
console.log('create calendar:', calendar);
|
|
162
|
+
},
|
|
163
|
+
onCalendarMerge: async (sourceId, targetId) => {
|
|
164
|
+
console.log('merge calendar:', sourceId, targetId);
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
});
|
|
89
168
|
```
|
|
90
169
|
|
|
91
|
-
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Event Detail Management
|
|
173
|
+
|
|
174
|
+
DayFlow includes a default event detail panel that supports editing:
|
|
175
|
+
|
|
176
|
+
- Title
|
|
177
|
+
- Time range
|
|
178
|
+
- Notes
|
|
92
179
|
|
|
93
|
-
|
|
94
|
-
- `react-dom` >= 18.0.0
|
|
95
|
-
- `lucide-react` >= 0.400.0
|
|
180
|
+
You can also pass a `meta` object to store custom fields such as **meeting links**, **locations**, etc.
|
|
96
181
|
|
|
97
|
-
|
|
182
|
+
<img width="536" height="323" alt="image" src="https://github.com/user-attachments/assets/7a599105-460e-4f83-8418-92bcd0ff8c2a" />
|
|
183
|
+
|
|
184
|
+
You can enable the detail panel as a modal dialog by passing `useEventDetailDialog` to `DayFlowCalendar`:
|
|
98
185
|
|
|
99
186
|
```tsx
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
187
|
+
<DayFlowCalendar calendar={calendar} useEventDetailDialog={true} />
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
<img width="1476" height="1108" alt="image" src="https://github.com/user-attachments/assets/c9f1e231-f8d1-4006-8ff1-942bb7491934" />
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
### Custom Event Detail Panel / Dialog
|
|
195
|
+
|
|
196
|
+
For fully customized UIs, you can replace the default detail panel or dialog by providing your own components via:
|
|
197
|
+
|
|
198
|
+
- `customDetailPanelContent`
|
|
199
|
+
- `customEventDetailDialog`
|
|
200
|
+
|
|
201
|
+
```tsx
|
|
202
|
+
<DayFlowCalendar
|
|
203
|
+
calendar={calendar}
|
|
204
|
+
customEventDetailDialog={CustomDialog} // Modal dialog
|
|
205
|
+
customDetailPanelContent={CustomContent} // Floating panel
|
|
206
|
+
/>
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
See the documentation for details:
|
|
210
|
+
|
|
211
|
+
- **Custom Event Detail Dialog**
|
|
212
|
+
https://dayflow-js.github.io/calendar/docs/features/custom-detail-dialog
|
|
213
|
+
- **Custom Event Detail Panel**
|
|
214
|
+
https://dayflow-js.github.io/calendar/docs/features/custom-detail-panel
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Sidebar
|
|
219
|
+
|
|
220
|
+
DayFlow ships with a powerful built-in sidebar.
|
|
221
|
+
|
|
222
|
+
You can:
|
|
103
223
|
|
|
104
|
-
|
|
224
|
+
- Drag calendars from the sidebar to create events
|
|
225
|
+
|
|
226
|
+

|
|
227
|
+
|
|
228
|
+
- Merge, delete, and recolor calendars
|
|
229
|
+
|
|
230
|
+
<img width="540" height="423" alt="image" src="https://github.com/user-attachments/assets/257a8671-e645-43fe-861e-613030f6c46e" />
|
|
231
|
+
|
|
232
|
+
- Use preset colors or choose custom colors via a color picker
|
|
233
|
+
|
|
234
|
+
<img width="872" height="708" alt="image" src="https://github.com/user-attachments/assets/bfda7cde-281e-4c23-86d6-910b13e7bc63" />
|
|
235
|
+
|
|
236
|
+
```tsx
|
|
237
|
+
const calendar = useCalendarApp({
|
|
238
|
+
views: [createMonthView(), createWeekView(), createDayView()],
|
|
239
|
+
plugins: [createDragPlugin()],
|
|
240
|
+
events,
|
|
241
|
+
calendars,
|
|
242
|
+
defaultView: ViewType.WEEK,
|
|
243
|
+
useSidebar: {
|
|
244
|
+
enabled: true,
|
|
245
|
+
width: 280,
|
|
246
|
+
},
|
|
247
|
+
});
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
### `useSidebar` Configuration
|
|
253
|
+
|
|
254
|
+
| Property | Type | Description | Default |
|
|
255
|
+
|------------------------------|--------------------------------------------------------------------|---------------------------------------------------------------------------------------------|------------|
|
|
256
|
+
| `enabled` | `boolean` | Whether the sidebar is enabled. | `true` |
|
|
257
|
+
| `width` | `number \| string` | Width of the sidebar (e.g., `240` or `'20%'`). | `'240px'` |
|
|
258
|
+
| `initialCollapsed` | `boolean` | Whether the sidebar is collapsed by default. | `false` |
|
|
259
|
+
| `render` | `(props: CalendarSidebarRenderProps) => React.ReactNode` | Full override for the sidebar UI. | - |
|
|
260
|
+
| `createCalendarMode` | `'inline' \| 'modal'` | Mode for creating new calendars: `inline` (direct edit in list) or `modal` (pop-up dialog). | `'inline'` |
|
|
261
|
+
| `renderCalendarContextMenu` | `(calendar: CalendarType, onClose: () => void) => React.ReactNode` | Custom renderer for the right-click context menu on calendar items. | - |
|
|
262
|
+
| `renderCreateCalendarDialog` | `(props: CreateCalendarDialogProps) => React.ReactNode` | Custom renderer for the calendar creation dialog (used in `modal` mode). | - |
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
### Custom Sidebar
|
|
268
|
+
|
|
269
|
+
If your project already has its own sidebar design, you can fully customize it using `useSidebar.render`.
|
|
270
|
+
|
|
271
|
+
This render function receives real-time calendar state and helper methods to interact with DayFlow core.
|
|
272
|
+
|
|
273
|
+
**`CalendarSidebarRenderProps` enables communication between your custom sidebar and DayFlow core.**
|
|
274
|
+
|
|
275
|
+
```tsx
|
|
276
|
+
import type { CalendarSidebarRenderProps } from '@dayflow/core';
|
|
277
|
+
|
|
278
|
+
const CustomSidebar = ({
|
|
279
|
+
app,
|
|
280
|
+
calendars,
|
|
281
|
+
toggleCalendarVisibility,
|
|
282
|
+
toggleAll,
|
|
283
|
+
isCollapsed,
|
|
284
|
+
setCollapsed,
|
|
285
|
+
}: CalendarSidebarRenderProps) => {
|
|
286
|
+
if (isCollapsed) {
|
|
287
|
+
return <button onClick={() => setCollapsed(false)}>Expand Sidebar</button>;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
return (
|
|
291
|
+
<aside className="flex h-full flex-col gap-4 p-4">
|
|
292
|
+
<header className="flex items-center justify-between">
|
|
293
|
+
<h3 className="text-sm font-semibold">Calendars</h3>
|
|
294
|
+
<div className="space-x-2">
|
|
295
|
+
<button onClick={() => toggleAll(true)}>Show All</button>
|
|
296
|
+
<button onClick={() => toggleAll(false)}>Hide All</button>
|
|
297
|
+
</div>
|
|
298
|
+
</header>
|
|
299
|
+
<ul className="space-y-2">
|
|
300
|
+
{calendars.map(calendar => (
|
|
301
|
+
<li key={calendar.id} className="flex items-center gap-2 text-sm">
|
|
302
|
+
<input
|
|
303
|
+
type="checkbox"
|
|
304
|
+
checked={calendar.isVisible}
|
|
305
|
+
onChange={() =>
|
|
306
|
+
toggleCalendarVisibility(calendar.id, !calendar.isVisible)
|
|
307
|
+
}
|
|
308
|
+
/>
|
|
309
|
+
<span
|
|
310
|
+
className="h-2.5 w-2.5 rounded-full"
|
|
311
|
+
style={{ backgroundColor: calendar.colors.eventColor }}
|
|
312
|
+
/>
|
|
313
|
+
{calendar.name}
|
|
314
|
+
</li>
|
|
315
|
+
))}
|
|
316
|
+
</ul>
|
|
317
|
+
<section className="rounded-xl border border-slate-200 p-3 text-xs">
|
|
318
|
+
<p>Current date: {app.getCurrentDate().toDateString()}</p>
|
|
319
|
+
<p>Total events: {app.getEvents().length}</p>
|
|
320
|
+
</section>
|
|
321
|
+
</aside>
|
|
322
|
+
);
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
const calendar = useCalendarApp({
|
|
326
|
+
/* ... */
|
|
327
|
+
useSidebar: {
|
|
328
|
+
enabled: true,
|
|
329
|
+
width: 320,
|
|
330
|
+
render: props => <CustomSidebar {...props} />,
|
|
331
|
+
},
|
|
332
|
+
});
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## Dark Mode
|
|
338
|
+
|
|
339
|
+
DayFlow Calendar natively supports full dark mode across views, sidebar, event cards, and dialogs.
|
|
340
|
+
|
|
341
|
+
<img width="1103" height="729" alt="image" src="https://github.com/user-attachments/assets/03c542d4-4b1b-4b99-9590-08c7be7f85df" />
|
|
342
|
+
|
|
343
|
+
You can switch between **light**, **dark**, or **auto** (follows system preference).
|
|
344
|
+
|
|
345
|
+
```tsx
|
|
346
|
+
import { DayFlowCalendar, useCalendarApp } from '@dayflow/core';
|
|
347
|
+
|
|
348
|
+
function MyCalendar() {
|
|
105
349
|
const calendar = useCalendarApp({
|
|
106
|
-
|
|
107
|
-
|
|
350
|
+
theme: {
|
|
351
|
+
mode: 'dark', // 'light' | 'dark' | 'auto'
|
|
352
|
+
},
|
|
108
353
|
});
|
|
109
354
|
|
|
110
355
|
return <DayFlowCalendar calendar={calendar} />;
|
|
111
356
|
}
|
|
112
357
|
```
|
|
113
358
|
|
|
114
|
-
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
## View Switcher Modes
|
|
115
362
|
|
|
116
|
-
|
|
363
|
+
The `switcherMode` option controls how the view switcher in the header is rendered.
|
|
117
364
|
|
|
118
|
-
DayFlow
|
|
365
|
+
DayFlow provides two built-in modes:
|
|
119
366
|
|
|
120
|
-
-
|
|
121
|
-
- 🎫 **Event Management**: Conference schedules, event calendars, festival planners
|
|
122
|
-
- 🏢 **Project Management**: Timeline views, task scheduling
|
|
123
|
-
- 💼 **Business**: Meeting rooms, resource booking, availability management
|
|
367
|
+
- **`buttons`**: Horizontal button tabs (default, ideal for desktop)
|
|
124
368
|
|
|
125
|
-
|
|
369
|
+
<img width="2190" height="406" alt="image" src="https://github.com/user-attachments/assets/a4be37bc-90ac-4872-afa0-589e3d1f7e9b" />
|
|
126
370
|
|
|
127
|
-
-
|
|
128
|
-
- ✅ **Drag & Drop**: Built-in drag and resize functionality
|
|
129
|
-
- ✅ **Virtual Scrolling**: Optimized rendering for large datasets
|
|
130
|
-
- ✅ **Plugin System**: Extensible with Events and Drag plugins
|
|
131
|
-
- ✅ **Modern React**: Hooks-based architecture (React 18+)
|
|
132
|
-
- ✅ **Tailwind CSS**: Easy styling customization
|
|
371
|
+
- **`select`**: Dropdown menu (space-saving, mobile-friendly)
|
|
133
372
|
|
|
134
|
-
|
|
373
|
+
<img width="2186" height="420" alt="image" src="https://github.com/user-attachments/assets/28e321ae-6c56-441a-a9fc-ddcfa504c920" />
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
## Contributing
|
|
135
378
|
|
|
136
379
|
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
137
380
|
|
|
138
|
-
##
|
|
381
|
+
## Bug Reports
|
|
139
382
|
|
|
140
383
|
If you find a bug, please file an issue on [GitHub Issues](https://github.com/dayflow-js/dayflow/issues).
|
|
141
384
|
|
|
142
|
-
##
|
|
385
|
+
## Support
|
|
143
386
|
|
|
144
387
|
For questions and support, please open an issue on GitHub or go to discord.
|
|
145
388
|
|
|
146
389
|
---
|
|
147
|
-
|
|
148
|
-
Made with ❤️ by Jayce Li
|