# Agenda Event

One event in an agenda list, with its start and end time, a color bar, details and guests.

- Category: Core Elements
- Page: https://wunderui.com/components/agenda-event
- Tier: Free

## Install

```bash
npx wunderui-cli add agenda-event
```

## Import

```tsx
import { AgendaEvent, AgendaEventChip, AgendaEventProps, EventChip } from "@/components/blocks/data"
```

## Minimal usage

Then use it:

```tsx
import { AgendaEvent } from "@/components/ui/agenda-event"

export function Event({ onOpen }: { onOpen: () => void }) {
  return (
    <div className="rounded-xl border border-border bg-card [&>*:first-child]:rounded-t-xl [&>*:last-child]:rounded-b-xl [&>*:last-child]:border-b-0">
      <AgendaEvent start="11:30" end="12:30" title="Design review" meta="Room Aurora" color="purple" onClick={onOpen} />
    </div>
  )
}
```

Expected result: You should see one row with the time 11:30 over 12:30, a purple bar, the title Design review and the room below it. Hover or Tab to it, then press Enter to open it.

## Usage

```tsx
import { AgendaEvent } from "@/components/ui/agenda-event"

const team = [
  { name: "Nora Lindgren", color: "indigo" },
  { name: "Daniel Okafor", color: "blue" },
  { name: "Priya Raman", color: "purple" },
  { name: "Tomás Ferreira", color: "green" },
  { name: "Maya Kessler", color: "pink" },
]

export function Example({ onOpen, onMenu }: { onOpen: () => void; onMenu: () => void }) {
  return (
    <div className="rounded-xl border border-border bg-card [&>*:first-child]:rounded-t-xl [&>*:last-child]:rounded-b-xl [&>*:last-child]:border-b-0">
      <AgendaEvent
        start="09:00"
        end="09:15"
        title="Team standup"
        meta="Zoom"
        color="indigo"
        guests={team.slice(0, 4)}
        onClick={onOpen}
        onMenu={onMenu}
      />
      <AgendaEvent
        start="11:30"
        end="12:30"
        title="Design review"
        meta="Room Aurora"
        color="purple"
        guests={team.slice(0, 3)}
        onClick={onOpen}
        onMenu={onMenu}
      />
      <AgendaEvent
        start="15:00"
        end="15:45"
        title="Client call"
        meta="Google Meet"
        color="green"
        guests={team.slice(0, 2)}
        onClick={onOpen}
        onMenu={onMenu}
      />
    </div>
  )
}
```

## When to use

### Use Agenda Event for

- A day or week schedule where an entry opens its details
- Meeting lists that show who is invited
- Event rows with a menu for edit, duplicate or delete

### Use something else

- [Agenda](https://wunderui.com/components/agenda) for a plain read-only list of times and titles
- [Calendar](https://wunderui.com/components/calendar) for a month grid, where an event shows as a small chip
- [Timeline](https://wunderui.com/components/timeline) for events that already happened, with a status and an exact date

## Keyboard

A clickable row has one Tab stop for the title and one for the menu button; a row without a click handler has none.

| Key | Action |
|---|---|
| `Tab` or `Shift+Tab` | Moves focus to the next or previous button: the title of a clickable row, then its menu button. |
| `Enter` or `Space` | On the title, calls `onClick` and opens the event. On the menu button, calls `onMenu` and does not open the event. |

Arrow keys do not move focus between rows. Each button is a separate Tab stop.

## Behavior

What the row does with its press target, content, the DOM and motion.

- **One press target:** With a click handler the whole row opens the event, by pointer or keyboard. Without one the row is static: no pointer cursor, no hover fill, no tab stop.
- **Hover and focus:** A clickable row fills light grey on hover. When the title has keyboard focus, the whole row gets an indigo border and a lighter 2 px ring.
- **The menu does not open the event:** The menu button sits above the title and stops the click, so it never opens the event. The row opens no menu itself: open yours from the menu handler and anchor it to the button.
- **Guests:** Guests overlap with a ring in the card colour. The first three show and the rest become a +N count; a guest shows a photo if given, otherwise initials.
- **One line each:** The title wraps to two lines, the detail line stays on one, and the time column keeps 64 px. On a narrow row the guests and menu wrap below the title.
- **Line below:** Every row draws a line below it. Wrap rows in a bordered, rounded container, remove the last line, and don't clip the container: the focus ring would be cut off.
- **Colours are fixed:** Eight colours: indigo, blue, purple, pink, red, orange, yellow, green. There is no custom colour, and purple is the default.
- **Plain markup:** A row is a plain div, not a list item, so give the list a heading nearby. The bar has no text; name the event kind in the title or detail line.
- **Motion and reduced motion:** The row adds no animation: the hover fill and the focus ring change at once. There is nothing to reduce.

## Anatomy

- `AgendaEvent`: One schedule row with a line below it. With a click handler the title becomes a button stretched over the whole row, with a hover fill and a focus ring.
- `Time`: The start time above an optional end time, in a fixed 64 px column, printed as written.
- `Colour bar`: A 3 px bar in the event colour (one of eight, purple by default). It is always shown.
- `Title`: The title, up to two lines, then an ellipsis. With a click handler it is a native button named by the title.
- `Details`: A line under the title in smaller tertiary text, such as the room or call link. Cut to one line.
- `Guests`: Overlapping avatars: the first three, then a +N count for the rest.
- `Menu button`: A small icon button named Event menu, shown when a menu handler is set. It sits above the stretched title, so clicking it does not open the event.
- `AgendaEventChip`: The compact form of an event for a day cell of a month grid: a 24 px label with a 3 px coloured bar and the truncated title. It is a button, so a Popover or Menu trigger can render it. It replaces EventChip.
- `EventChip`
- `Meta`

## Best practices

### When to use

- Use an Agenda Event for a schedule row with guests, a menu or a detail view to open. For a plain read-only list of times and titles, use Agenda.

### Do

- Pass a click handler instead of wrapping the row in a link or button. The title becomes a real button over the whole row, and the menu button stays reachable.
- Keep the title short and put the place or call details on the line below it.
- Give every guest a name. It becomes the avatar's hover title and the source of the initials when there is no photo.
- Put rows in a bordered, rounded container with the last line removed and the outer corners rounded. Each row draws its own line below, so the last one would double the border.
- Pass wrap where the meta line or the title runs long (phones): nothing is clamped or truncated.

### Don't

- Don't let the colour bar carry the meaning alone. It has no text, so name the kind of event in the title or detail line too.
- Don't add overflow-hidden to the container. It clips the focus ring, which is drawn outside the row.
- Don't put buttons or links inside the title or detail line. The title is already a button, and a control inside a button is invalid HTML; use the menu for extra actions.

## API reference

### AgendaEvent

| Prop | Type | Default | Description |
|---|---|---|---|
| start* | React.ReactNode |  | The start time, shown in the first line of the time column. Printed as written, so format it yourself, for example `09:00`. |
| title* | React.ReactNode |  | The name of the event, up to two lines, then an ellipsis. With `onClick` it is the label of the row's button, so write it as plain text. |
| className | string |  | Extra classes for the row, merged after the defaults, for example to remove the line below with `border-b-0`. |
| color | "indigo" \| "blue" \| "purple" \| "pink" \| "red" \| "orange" \| "yellow" \| "green" | "purple" | The hue of the bar next to the title: `indigo`, `blue`, `purple`, `pink`, `red`, `orange`, `yellow` or `green`. Use it to tell kinds of events apart, and say the kind in the text as well. |
| end | React.ReactNode |  | The end time, shown under the start time in smaller, lighter text. Leave it out for an event without a fixed end. |
| guests | { name: string; initials?: string; src?: string; color?: AvatarColor }[] |  | The people invited. The first three are shown as overlapping avatars, the rest as a `+N` count. `name` is the hover title, `initials` replaces the ones taken from the name, `src` shows a photo and `color` sets the avatar colour. |
| meta | React.ReactNode |  | A second line under the title, in smaller tertiary text, for the room, the call link or the organiser. Truncated to one line. |
| onClick | () => void |  | Called when the row is pressed or its title button is activated. Setting it makes the title a button over the whole row and adds the hover fill and the focus ring. |
| onMenu | () => void |  | Called when the `Event menu` button is pressed. Setting it shows the button at the right end of the row. It does not trigger `onClick`; open your own menu from here. |
| wrap | boolean | false | The title and the meta line wrap onto more lines instead of clamping (title, 2 lines) and truncating (meta). Default: false. |

### AgendaEventChip

| Prop | Type | Default | Description |
|---|---|---|---|
| color | "indigo" \| "blue" \| "purple" \| "pink" \| "red" \| "orange" \| "yellow" \| "green" | "indigo" | One of the eight event colours. Indigo by default. |

Also accepts React.ButtonHTMLAttributes attributes.

### EventChip

| Prop | Type | Default |
|---|---|---|
| color | "indigo" \| "blue" \| "purple" \| "pink" \| "red" \| "orange" \| "yellow" \| "green" |  |

Also accepts React.ButtonHTMLAttributes attributes.

## Examples

### Colour: indigo, blue, purple, pink, red, orange, yellow and green

```tsx
import { AgendaEvent } from "@/components/ui/agenda-event"

export function Example() {
  return (
    <div className="rounded-xl border border-border bg-card [&>*:first-child]:rounded-t-xl [&>*:last-child]:rounded-b-xl [&>*:last-child]:border-b-0">
      <AgendaEvent start="11:30" end="12:30" title="Design review" meta="Room Aurora" color="purple" />
    </div>
  )
}
```

### Content: time, details, guests and long text

```tsx
import { AgendaEvent } from "@/components/ui/agenda-event"

export function Example() {
  return (
    <div className="rounded-xl border border-border bg-card [&>*:first-child]:rounded-t-xl [&>*:last-child]:rounded-b-xl [&>*:last-child]:border-b-0">
      <AgendaEvent start="11:30" end="12:30" title="Design review" meta="Room Aurora" color="purple" />
    </div>
  )
}
```

### Interaction: static, opens the event, with a menu, or both

```tsx
import { AgendaEvent } from "@/components/ui/agenda-event"

const team = [
  { name: "Nora Lindgren", color: "indigo" },
  { name: "Daniel Okafor", color: "blue" },
  { name: "Priya Raman", color: "purple" },
  { name: "Tomás Ferreira", color: "green" },
  { name: "Maya Kessler", color: "pink" },
]

export function Example({ onOpen, onMenu }: { onOpen: () => void; onMenu: () => void }) {
  return (
    <div className="rounded-xl border border-border bg-card [&>*:first-child]:rounded-t-xl [&>*:last-child]:rounded-b-xl [&>*:last-child]:border-b-0">
      <AgendaEvent
        start="11:30"
        end="12:30"
        title="Design review"
        meta="Room Aurora"
        color="purple"
        guests={team.slice(0, 3)}
        onClick={onOpen}
        onMenu={onMenu}
      />
    </div>
  )
}
```

### States: default, hover and focus visible

```tsx
import { AgendaEvent } from "@/components/ui/agenda-event"

const team = [
  { name: "Nora Lindgren", color: "indigo" },
  { name: "Daniel Okafor", color: "blue" },
  { name: "Priya Raman", color: "purple" },
  { name: "Tomás Ferreira", color: "green" },
  { name: "Maya Kessler", color: "pink" },
]

export function Example({ onOpen, onMenu }: { onOpen: () => void; onMenu: () => void }) {
  return (
    <div className="rounded-xl border border-border bg-card [&>*:first-child]:rounded-t-xl [&>*:last-child]:rounded-b-xl [&>*:last-child]:border-b-0">
      <AgendaEvent
        start="11:30"
        end="12:30"
        title="Design review"
        meta="Room Aurora"
        color="purple"
        guests={team.slice(0, 3)}
        onClick={onOpen}
        onMenu={onMenu}
      />
    </div>
  )
}
```

### Chip: a small coloured label for a day cell

```tsx
import { AgendaEventChip } from "@wunderui/react"

export function DayCell({ onOpen }: { onOpen: (title: string) => void }) {
  return (
    <div className="flex w-44 flex-col gap-1 rounded-md border border-border bg-card p-1.5">
      <span className="px-1 text-xs font-medium text-foreground">24</span>
      <AgendaEventChip color="indigo" onClick={() => onOpen("Standup")}>Standup</AgendaEventChip>
      <AgendaEventChip color="purple" onClick={() => onOpen("Design review")}>Design review</AgendaEventChip>
      <AgendaEventChip color="green" onClick={() => onOpen("Lunch with Maya")}>Lunch with Maya</AgendaEventChip>
      <AgendaEventChip color="orange" onClick={() => onOpen("Release 2.4")}>Release 2.4</AgendaEventChip>
    </div>
  )
}
```

## In context

### Day view: open an event and its menu from a list

```tsx
import { useState } from "react"
import { AgendaEvent } from "@/components/ui/agenda-event"

const team = [
  { name: "Nora Lindgren", color: "indigo" },
  { name: "Daniel Okafor", color: "blue" },
  { name: "Priya Raman", color: "purple" },
  { name: "Tomás Ferreira", color: "green" },
  { name: "Maya Kessler", color: "pink" },
]

export function DayView() {
  const [status, setStatus] = useState<string | null>(null)
  return (
    <section className="mx-auto flex w-full max-w-[560px] flex-col gap-3">
      <h2 className="text-sm font-semibold text-foreground">Tuesday, Nov 10</h2>
      <div className="rounded-xl border border-border bg-card [&>*:first-child]:rounded-t-xl [&>*:last-child]:rounded-b-xl [&>*:last-child]:border-b-0">
        <AgendaEvent
          start="09:00"
          end="09:15"
          title="Team standup"
          meta="Zoom"
          color="indigo"
          guests={team.slice(0, 2)}
          onClick={() => setStatus("Opened Team standup")}
          onMenu={() => setStatus("Menu of Team standup")}
        />
        <AgendaEvent
          start="11:30"
          end="12:30"
          title="Design review"
          meta="Room Aurora"
          color="purple"
          guests={team.slice(0, 2)}
          onClick={() => setStatus("Opened Design review")}
          onMenu={() => setStatus("Menu of Design review")}
        />
        <AgendaEvent
          start="13:00"
          end="14:00"
          title="Lunch with Maya Kessler"
          meta="Garden Street Café"
          color="orange"
          guests={[team[0]]}
          onClick={() => setStatus("Opened Lunch with Maya Kessler")}
          onMenu={() => setStatus("Menu of Lunch with Maya Kessler")}
        />
        <AgendaEvent
          start="15:00"
          end="15:45"
          title="Client call"
          meta="Google Meet"
          color="green"
          guests={team.slice(0, 2)}
          onClick={() => setStatus("Opened Client call")}
          onMenu={() => setStatus("Menu of Client call")}
        />
      </div>
      <p className="min-h-5 text-xs text-text-secondary" aria-live="polite">
        {status ?? "Click an event or open its menu."}
      </p>
    </section>
  )
}
```

### Schedule: a day with a count, and an Empty State for a free day

```tsx
import { AgendaEvent } from "@/components/ui/agenda-event"
import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
import { EmptyState } from "@/components/ui/empty-state"
import { CalendarCheck } from "lucide-react"

type DayEvent = {
  id: string
  start: string
  end: string
  title: string
  meta: string
  color: "indigo" | "purple" | "orange" | "green"
}

export function Schedule({ events, onOpen }: { events: DayEvent[]; onOpen: (id: string) => void }) {
  return (
    <section className="mx-auto flex w-full max-w-[560px] flex-col gap-3">
      <div className="flex items-center justify-between gap-3">
        <h2 className="text-sm font-semibold text-foreground">Tuesday, Nov 10</h2>
        <Badge color="indigo" badgeStyle="light" shape="pill" className="h-5 px-2 text-xs">
          {events.length} events
        </Badge>
      </div>
      {events.length === 0 ? (
        <EmptyState
          title="Nothing planned"
          description="You have no events on this day."
          icon={<CalendarCheck />}
          action={<Button variant="plain" size="sm">Add event</Button>}
        />
      ) : (
        <div className="rounded-xl border border-border bg-card [&>*:first-child]:rounded-t-xl [&>*:last-child]:rounded-b-xl [&>*:last-child]:border-b-0">
          {events.map((event) => (
            <AgendaEvent
              key={event.id}
              start={event.start}
              end={event.end}
              title={event.title}
              meta={event.meta}
              color={event.color}
              onClick={() => onOpen(event.id)}
            />
          ))}
        </div>
      )}
    </section>
  )
}
```

### Invites: long titles on a narrow screen

```tsx
import { AgendaEvent } from "@/components/ui/agenda-event"

const team = [
  { name: "Nora Lindgren", color: "indigo" },
  { name: "Daniel Okafor", color: "blue" },
  { name: "Priya Raman", color: "purple" },
  { name: "Tomás Ferreira", color: "green" },
  { name: "Maya Kessler", color: "pink" },
]

export function Invites({ onOpen, onMenu }: { onOpen: () => void; onMenu: () => void }) {
  return (
    <div className="rounded-xl border border-border bg-card [&>*:first-child]:rounded-t-xl [&>*:last-child]:rounded-b-xl [&>*:last-child]:border-b-0">
      <AgendaEvent
        start="10:00"
        end="12:00"
        title="Quarterly planning workshop with the product, design and engineering leads"
        meta="Room Aurora, 2nd floor, with a video link for people who join from home"
        color="blue"
        guests={team.slice(0, 2)}
        onClick={onOpen}
        onMenu={onMenu}
      />
      <AgendaEvent
        start="13:30"
        end="14:00"
        title="Onboarding for new team members"
        meta="Zoom"
        color="pink"
        guests={[team[0]]}
        onClick={onOpen}
        onMenu={onMenu}
      />
      <AgendaEvent
        start="16:00"
        end="16:45"
        title="Sprint retrospective with the whole team"
        meta="Room 3B"
        color="yellow"
        guests={team.slice(0, 2)}
        onClick={onOpen}
        onMenu={onMenu}
      />
    </div>
  )
}
```

### Long texts wrap

`wrap` lets the title and the meta line take more lines instead of clamping and truncating, e.g. on a phone.

```tsx
<AgendaEvent wrap start="09:30" end="10:15" title="Renewal review" meta="Work · Room 4, second floor" />
```

## For AI agents

`get_component("agenda-event")`

Hand your agent this page as Markdown or the WunderUI MCP server, not a screenshot.
