---
title: "Angular Agenda Customizable Day Headers Example | Mobiscroll"
component: "Agenda"
framework: "Angular"
library_version: "6.1.5"
url: "https://demo.mobiscroll.com/angular/agenda/customizing-day-header"
---

# Customizable Day Headers - Angular Agenda demo

Build customizable Angular agenda day headers — style date labels and add per-day action buttons, including headers for days without events. For Angular 22 and Ionic 8.

- [Live demo](https://demo.mobiscroll.com/angular/agenda/customizing-day-header)
- [View code on GitHub](https://github.com/acidb/mobiscroll-demos-angular/tree/main/src/demos/eventcalendar/agenda/customizing-day-header)
- This demo in other frameworks: [JavaScript](https://demo.mobiscroll.com/javascript/agenda/customizing-day-header.md), [jQuery](https://demo.mobiscroll.com/jquery/agenda/customizing-day-header.md), [React](https://demo.mobiscroll.com/react/agenda/customizing-day-header.md), [Vue](https://demo.mobiscroll.com/vue/agenda/customizing-day-header.md)

## Description

You can use [`agendaDayTemplate`](https://mobiscroll.com/docs/angular/eventcalendar/api#template-agendaDayTemplate) to set up a custom day header template. This provides flexibility to format and style the date according to your preferences, allowing further customization of the headers and ensuring a consistent layout that matches your page's overall design.

In this demo, setting the `showEmptyDays` property to true allows us to add functionalities to the day header, such as creating new events for empty days, which is useful in various situations.

## What this demo shows

- Shows a monthly agenda view with events listed and grouped by date.
- **Header navigation** The month and year label in the top left opens date navigation. The previous and next arrows and the Today button on the right move between months and jump back to the current date.
- **Agenda list** The area below the header lists events for the selected month. Events in the agenda are grouped by date.
- **Sticky day headers** As the agenda scrolls vertically, each day stays visible with a sticky date header while its events appear underneath.
- **Custom day headers** Each day header includes a blue + Add event button on the right. The button is highlighted on hover.
- **Adding events** Clicking + Add event creates an event for that day and displays an Event added toast at the bottom center of the agenda.
- **Events** Events appear as agenda cards with a colored strip on the left and the event title next to it. Start and end times are stacked on the right side of timed events. All-day events show the all-day label on the right.
- **Event interaction** Hovering an event highlights it.
- **Event selection** Clicking an event selects and highlights it.

## Best for

- **Daily event creation** Agenda interfaces where users need to add an event directly from the relevant date header, including days that do not yet contain events.
- **Appointment calendars** Month-based appointment lists that keep date context visible while users review and add appointments.
- **Workforce scheduling** Shift or assignment agendas where schedulers need a quick date-specific action for creating new entries.
- **Operations planning** Delivery, maintenance, or service schedules organized by day, with a persistent date header during scrolling.

## API used in this demo

- [`theme`](https://mobiscroll.com/docs/angular/eventcalendar/api#opt-theme) - option
- [`themeVariant`](https://mobiscroll.com/docs/angular/eventcalendar/api#opt-themeVariant) - option
- [`view`](https://mobiscroll.com/docs/angular/eventcalendar/api#opt-view) - option
- [`data`](https://mobiscroll.com/docs/angular/eventcalendar/api#opt-data) - option
- [`agendaDayTemplate`](https://mobiscroll.com/docs/angular/eventcalendar/api#template-agendaDayTemplate) - template

## Code

### Component

```ts
import { CommonModule } from '@angular/common';
import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import {
  formatDate,
  MbscCalendarEvent,
  MbscEventcalendarView,
  MbscModule,
  Notifications,
  setOptions,
} from '@mobiscroll/angular';

setOptions({
  theme: 'ios',
  themeVariant: 'light'
});

@Component({
  selector: 'app-root', 
  templateUrl: './app.component.html',
  standalone: true,
  imports: [CommonModule, MbscModule],
})
export class AppComponent implements OnInit {
  constructor(
    private http: HttpClient,
    private notify: Notifications,
  ) {}

  myEvents: MbscCalendarEvent[] = [];
  myView: MbscEventcalendarView = { agenda: { type: 'week', showEmptyDays: true } };

  formatDate = formatDate;

  addEvent(date: Date): void {
    const newEvent = {
      title: 'Event',
      start: date,
      allDay: true,
    };

    this.myEvents = [...this.myEvents, newEvent];

    this.notify.toast({
      message: 'Event added',
    });
  }

  ngOnInit(): void {
    this.http.jsonp<MbscCalendarEvent[]>('https://trial.mobiscroll.com/events/?vers=5', 'callback').subscribe((resp) => {
      this.myEvents = resp;
    });
  }
}
```

### Template

```html
<mbsc-eventcalendar class="mds-custom-day-header" [view]="myView" [data]="myEvents" [agendaDayTemplate]="customDayTemplate">
  <ng-template #customDayTemplate let-day>
    <div class="mbsc-flex mbsc-flex-1-1 mbsc-align-items-center">
      <div class="mbsc-flex-1-1">{{ formatDate('D MMM YYYY', day.date) }}</div>
      <mbsc-button class="mds-custom-day-header-btn" color="primary" startIcon="plus" variant="outline" (click)="addEvent(day.date)">
        Add event
      </mbsc-button>
    </div>
  </ng-template>
</mbsc-eventcalendar>
```

### CSS

```css
.mds-custom-day-header .mbsc-event-day.mbsc-windows {
  padding: 8px 24px;
}

.mds-custom-day-header-btn.mbsc-button {
  height: 24px;
  line-height: 24px;
  margin: 0;
  padding: 0 10px;
}

.mds-custom-day-header-btn .mbsc-button-txt {
  font-size: 12px;
}

.mds-custom-day-header-btn .mbsc-button-icon {
  width: 16px;
  height: 16px;
  line-height: 16px;
  font-size: 14px;
}
```

## Implementation notes

- Use `view: { agenda: { type: 'month', showEmptyDays: true } }`. `showEmptyDays: true` ensures days with no events still render their day header row, which is where the custom template appears.
- Pass a custom day header via `renderAgendaDay` (React/JS/jQuery) / `agendaDayTemplate` (Angular) / `agendaDay` slot (Vue). The template receives the `day` object - render the date with `formatDate('D MMM YYYY', day.date)` and an "Add event" Button alongside it.
- On "Add event" click: append `{ title: 'Event', start: day.date }` to the events array (frameworks) or call `inst.addEvent(...)` (JS/jQuery), then show a Toast confirmation. Load initial events from `https://trial.mobiscroll.com/events/?vers=5` via JSONP using `getJson(url, callback, 'jsonp')`. Angular: use `HttpClient.jsonp()`. JS/jQuery: call `inst.setEvents(events)` in the callback.

## Run it in your project

1. If not signed up yet, or don't own a license, you can [start a free trial](https://mobiscroll.com/starttrial).

2. Clone the repository:

   ```
   git clone https://github.com/acidb/mobiscroll-demos-angular.git
   ```

3. If not installed yet, install the Mobiscroll CLI from NPM:

   ```
   npm install -g @mobiscroll/cli
   ```

4. Config Mobiscroll - open a terminal window in the root directory and run:

   ```
   mobiscroll config angular
   ```

5. Install dependencies - open a terminal window in the root directory and run:

   ```
   npm install
   ```

6. Run the project:

   ```
   ng serve
   ```

On a trial, add `--trial` to the config command: `mobiscroll config angular --trial`.

Running a demo locally requires a Mobiscroll trial or a license; setup is per framework at https://mobiscroll.com/docs/angular/getting-started/installation

## Related demos

- Previous: [Event Calendar Agenda Custom Header](https://demo.mobiscroll.com/angular/agenda/customizing-calendar-header.md) - Build a custom Angular event calendar agenda header — rearrange navigation controls, add a view switcher, and control layout per theme.
- Next: [Event Tooltip](https://demo.mobiscroll.com/angular/agenda/custom-event-tooltip.md) - Add hover tooltips to Angular agenda events showing appointment details and inline actions — choose native, custom popup, or third-party tooltip.
