# Event Invite

> An invitation inside a mail: date, time, place, organizer and guests, what else is in the calendar at that time (others, [] for "nothing else"), and Accept, Maybe and Decline with "Add to calendar".

Component · Data · Halo kit · [Live page](https://ui.twentyfirst.media/halo/components/EventInvite/)

An invitation inside a mail: date, time, place, organizer and guests, what else is in the calendar at that time (`others`, `[]` for "nothing else"), and Accept, Maybe and Decline with "Add to calendar".

- `status="updated"` marks changes from the organizer (`changes` says what), `status="cancelled"` strikes it through and offers "Remove from calendar" (`onRemove`) when it is in the calendar.
- `response`/`onRespond` (or `defaultResponse`) hold your reply; `busy` while it is being sent.

## Example

```tsx
import * as React from "react";
import { EventInvite } from "@twentyfirstmedia/halo";
import type { CalendarRsvp } from "@twentyfirstmedia/halo";

const at = (day: number, h: number, m = 0) => new Date(2026, 3, day, h, m);

export default function Preview() {
  const [reply, setReply] = React.useState<CalendarRsvp | null>(null);
  const [added, setAdded] = React.useState(false);
  return (
    <div className="tf-col" style={{ gap: 16 }}>
      <EventInvite
        title="Quarterly planning"
        start={at(20, 10)}
        end={at(20, 11, 30)}
        location="Room 4, second floor"
        organizer={{ name: "Lena Hart", email: "lena@example.com" }}
        guests={8}
        others={[{ title: "Standup", start: at(20, 10), end: at(20, 10, 15), tint: "mint" }]}
        response={reply}
        onRespond={setReply}
        added={added}
        onAddToCalendar={() => setAdded(true)}
      />
      <EventInvite
        title="Partner call with Northwind"
        start={at(21, 15)}
        end={at(21, 16)}
        location="Video call"
        organizer={{ name: "Noah Berg", email: "noah@example.com" }}
        status="updated"
        changes="New time: Tuesday 15:00 instead of Monday 14:00."
        others={[]}
        defaultResponse="accepted"
        onRespond={() => {}}
        added
        onAddToCalendar={() => {}}
      />
      <EventInvite
        title="Team offsite"
        start={at(22, 9)}
        end={at(22, 17)}
        organizer={{ name: "Mara Ellis" }}
        status="cancelled"
        added
        onRemove={() => {}}
      />
    </div>
  );
}
```

## Props

### EventInvite

| Prop | Type | Notes |
| --- | --- | --- |
| `title` | `string` | Required |
| `start` | `Date \| string \| number` | Required |
| `end` | `Date \| string \| number` | Required |
| `allDay?` | `boolean` |  |
| `location?` | `string` |  |
| `organizer?` | `{ name: string; email?: string }` |  |
| `guests?` | `number` | Number of guests. |
| `others?` | `{ title: string; start: Date \| string \| number; end: Date \| string \| number; allDay?: boolean; tint?: Tint; }[]` | What else is in the calendar at that time; `[]` says the time is free. |
| `status?` | `"new" \| "updated" \| "cancelled"` | "updated" (the organizer changed it) or "cancelled". |
| `changes?` | `ReactNode` | What changed, for an update ("New time: 15:00"). |
| `response?` | `CalendarRsvp \| null` | Your answer (controlled) / initially / when a button is pressed. |
| `defaultResponse?` | `CalendarRsvp \| null` |  |
| `onRespond?` | `(response: CalendarRsvp) => void` |  |
| `onAddToCalendar?` | `() => void` | Shows "Add to calendar"; with `added` it says "In your calendar". |
| `added?` | `boolean` |  |
| `onRemove?` | `() => void` | For a cancelled event that is in the calendar: "Remove from calendar". |
| `busy?` | `boolean` | A reply is being sent: buttons wait. |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |
