Skip to content

Components · Input

EventEditor

Full event create/edit form. Handles participant and resource pickers, recurrence rules, and pre-submit validation against the engine.

Key points

  • Two modes: create (initialValues) and edit (eventId)
  • Built-in pickers for primary entity, participants, and resources
  • Recurrence rule builder when the event type allows series
  • Runs a conflict-detect call before onSubmit fires — surfaces 409s in-form

Import

import { EventEditor } from '@flexischeduler/scheduling-components';

Create mode

<EventEditor
  mode="create"
  initialValues={{
    eventType: 'home_visit',
    primaryEntityId: 'ent_pt_9001',
    startTime: selectedSlot.startTime,
    endTime: selectedSlot.endTime,
  }}
  onSubmit={async (event) => {
    const created = await api.createEvent(event);
    navigate(`/events/${created.id}`);
  }}
/>

Reference

Props

Name

Type

Description

mode

required

"create" | "edit"

Editor mode

initialValues
Partial<Event>

Prefill fields (create mode only)

eventId
string

Event to edit (edit mode only)

showRecurrence
boolean

default: true

Show recurrence rule builder

allowResourceOverride
boolean

default: false

Let users override engine resource suggestions

submitLabel
string

default: "Save"

Submit button label

Events

Event

Payload

Fires when

onSubmit(values: EventDto) => Promise<void>

Form submitted; consumer calls the engine

onCancel() => void

User cancelled editing

onValidationError(errors: Record<string, string>) => void

Pre-submit validation failed

Slots

Slot

Description

header

Above the form fields

footer

Below the action buttons (e.g. additional metadata, custom hints)

Edit mode

<EventEditor
  mode="edit"
  eventId="evt_b29f4e58"
  onSubmit={async (changes) => {
    await api.updateEvent(eventId, changes);
    refetch();
  }}
  onCancel={() => navigate(-1)}
/>

Recurrence is event-type aware

The recurrence rule builder only renders if the event type configured in your template allows series. The component checks this automatically — you don’t need to gate the prop.