Pular para o conteúdo
efDS.ui
GitHub (repositório do código)

Agenda

Agenda mensal: a grade de um mês com os eventos de cada dia. Navega por mês anterior, próximo e hoje; em contêiner estreito vira uma lista por dia.

Quando usar

  • Para mostrar prazos, reuniões e vencimentos distribuídos pelo mês.
  • Com eventos que levam a um registro (link) ou abrem um detalhe (botão).

Quando não usar

  • Para escolher uma data num formulário: use DatePicker.
  • Para arrastar ou redimensionar eventos: está fora desta versão.

Exemplo

Mês com eventos

Eventos com hora, de dia inteiro e de vários dias. Com mais de três num dia, “+N mais” abre um Popover com todos. Hoje é marcado por aria-current e pelo texto “Hoje”.

Março de 2026

Agenda de março de 2026
Dom Seg Ter Qua Qui Sex Sáb
domingo
segunda-feira
terça-feira
quarta-feira
quinta-feira
sexta-feira
sábado
domingo
segunda-feira
terça-feira
quarta-feira
quinta-feira
sexta-feira
sábado
domingo
segunda-feira
terça-feira
quarta-feiraHoje
quinta-feira
sexta-feira
sábado
domingo
segunda-feira
terça-feira
quarta-feira
quinta-feira
sexta-feira
sábado
domingo
segunda-feira
terça-feira
quarta-feira
quinta-feira
sexta-feira
sábado

Nenhum evento neste mês.

Ícones SVG abreviados aqui; a cópia traz o código completo.
<!-- Behavior: [data-eds-agenda] (navegação do mês). Botões [data-eds-agenda-prev], [data-eds-agenda-next] e
     [data-eds-agenda-today]; o título tem aria-live="polite" e muda com o mês. "+N mais" abre um Popover
     (popovertarget). Os nomes de mês e de dia seguem o locale do DatePicker. Em contêiner estreito (< 40rem)
     a grade vira lista por dia. Eventos: eds:agenda-month-change e eds:agenda-event-click. Sem arrastar eventos. -->
<section class="eds-agenda" aria-labelledby="ag-titulo" data-eds-agenda data-eds-agenda-month="2026-03">
  <header class="eds-agenda-header">
    <h2 class="eds-agenda-title" id="ag-titulo" aria-live="polite">Março de 2026</h2>
    <div class="eds-agenda-nav">
      <button type="button" class="eds-button eds-button-secondary eds-button-sm" data-eds-agenda-today>Hoje</button>
      <button type="button" class="eds-button eds-button-ghost eds-button-icon eds-button-sm" aria-label="Mês anterior" data-eds-agenda-prev>
        <!-- ícone: svg com aria-hidden="true" -->
      </button>
      <button type="button" class="eds-button eds-button-ghost eds-button-icon eds-button-sm" aria-label="Próximo mês" data-eds-agenda-next>
        <!-- ícone: svg com aria-hidden="true" -->
      </button>
    </div>
  </header>
  <table class="eds-agenda-grid">
    <caption class="eds-visually-hidden">Agenda de março de 2026</caption>
    <thead>
      <tr>
        <th scope="col"><abbr title="domingo">Dom</abbr></th>
        <th scope="col"><abbr title="segunda-feira">Seg</abbr></th>
        <th scope="col"><abbr title="terça-feira">Ter</abbr></th>
        <th scope="col"><abbr title="quarta-feira">Qua</abbr></th>
        <th scope="col"><abbr title="quinta-feira">Qui</abbr></th>
        <th scope="col"><abbr title="sexta-feira">Sex</abbr></th>
        <th scope="col"><abbr title="sábado">Sáb</abbr></th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">domingo</span><time class="eds-agenda-date" datetime="2026-03-01">1</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">segunda-feira</span><time class="eds-agenda-date" datetime="2026-03-02">2</time></div>
          <ul class="eds-agenda-events">
            <li><a class="eds-agenda-event" href="#/agenda/1" data-tone="info"><span class="eds-agenda-event-time">09:00</span><span class="eds-agenda-event-title">Reunião de equipe</span></a></li>
          </ul>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">terça-feira</span><time class="eds-agenda-date" datetime="2026-03-03">3</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">quarta-feira</span><time class="eds-agenda-date" datetime="2026-03-04">4</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">quinta-feira</span><time class="eds-agenda-date" datetime="2026-03-05">5</time></div>
          <ul class="eds-agenda-events">
            <li><a class="eds-agenda-event" href="#/agenda/2" data-tone="success"><span class="eds-agenda-event-time">14:30</span><span class="eds-agenda-event-title">Entrega do relatório</span></a></li>
          </ul>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">sexta-feira</span><time class="eds-agenda-date" datetime="2026-03-06">6</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">sábado</span><time class="eds-agenda-date" datetime="2026-03-07">7</time></div>
        </td>
      </tr>
      <tr>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">domingo</span><time class="eds-agenda-date" datetime="2026-03-08">8</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">segunda-feira</span><time class="eds-agenda-date" datetime="2026-03-09">9</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">terça-feira</span><time class="eds-agenda-date" datetime="2026-03-10">10</time></div>
          <ul class="eds-agenda-events">
            <li><a class="eds-agenda-event" href="#/agenda/3" data-tone="warning"><span class="eds-agenda-event-time">10:00</span><span class="eds-agenda-event-title">Revisão de contrato</span></a></li>
          </ul>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">quarta-feira</span><time class="eds-agenda-date" datetime="2026-03-11">11</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">quinta-feira</span><time class="eds-agenda-date" datetime="2026-03-12">12</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">sexta-feira</span><time class="eds-agenda-date" datetime="2026-03-13">13</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">sábado</span><time class="eds-agenda-date" datetime="2026-03-14">14</time></div>
        </td>
      </tr>
      <tr>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">domingo</span><time class="eds-agenda-date" datetime="2026-03-15">15</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">segunda-feira</span><time class="eds-agenda-date" datetime="2026-03-16">16</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">terça-feira</span><time class="eds-agenda-date" datetime="2026-03-17">17</time></div>
        </td>
        <td class="eds-agenda-day" aria-current="date">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">quarta-feira</span><time class="eds-agenda-date" datetime="2026-03-18">18</time><span class="eds-agenda-today">Hoje</span></div>
          <ul class="eds-agenda-events">
            <li><a class="eds-agenda-event" href="#/agenda/4" data-tone="info"><span class="eds-agenda-event-time">08:30</span><span class="eds-agenda-event-title">Alinhamento semanal</span></a></li>
            <li><a class="eds-agenda-event" href="#/agenda/5"><span class="eds-agenda-event-time">11:00</span><span class="eds-agenda-event-title">Planejamento do trimestre</span></a></li>
            <li><button type="button" class="eds-agenda-more" popovertarget="ag-mais-18" data-eds-popover="bottom" aria-haspopup="dialog" aria-label="2 mais eventos em quarta-feira, 18 de março">+2 mais</button></li>
          </ul>
          <div class="eds-popover" id="ag-mais-18" popover role="dialog" aria-labelledby="ag-mais-18-t" data-eds-popover>
            <h3 class="eds-popover-title" id="ag-mais-18-t">Quarta-feira, 18 de março</h3>
            <ul class="eds-agenda-events">
              <li><a class="eds-agenda-event" href="#/agenda/6" data-tone="danger"><span class="eds-agenda-event-time">15:00</span><span class="eds-agenda-event-title">Prazo de entrega</span></a></li>
              <li><a class="eds-agenda-event" href="#/agenda/7" data-tone="neutral"><span class="eds-agenda-event-time">17:00</span><span class="eds-agenda-event-title">Encerramento do dia</span></a></li>
            </ul>
          </div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">quinta-feira</span><time class="eds-agenda-date" datetime="2026-03-19">19</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">sexta-feira</span><time class="eds-agenda-date" datetime="2026-03-20">20</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">sábado</span><time class="eds-agenda-date" datetime="2026-03-21">21</time></div>
        </td>
      </tr>
      <tr>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">domingo</span><time class="eds-agenda-date" datetime="2026-03-22">22</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">segunda-feira</span><time class="eds-agenda-date" datetime="2026-03-23">23</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">terça-feira</span><time class="eds-agenda-date" datetime="2026-03-24">24</time></div>
          <ul class="eds-agenda-events">
            <li><a class="eds-agenda-event" href="#/agenda/8" data-tone="success"><span class="eds-agenda-event-time">09:30</span><span class="eds-agenda-event-title">Treinamento</span></a></li>
          </ul>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">quarta-feira</span><time class="eds-agenda-date" datetime="2026-03-25">25</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">quinta-feira</span><time class="eds-agenda-date" datetime="2026-03-26">26</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">sexta-feira</span><time class="eds-agenda-date" datetime="2026-03-27">27</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">sábado</span><time class="eds-agenda-date" datetime="2026-03-28">28</time></div>
        </td>
      </tr>
      <tr>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">domingo</span><time class="eds-agenda-date" datetime="2026-03-29">29</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">segunda-feira</span><time class="eds-agenda-date" datetime="2026-03-30">30</time></div>
        </td>
        <td class="eds-agenda-day">
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">terça-feira</span><time class="eds-agenda-date" datetime="2026-03-31">31</time></div>
        </td>
        <td class="eds-agenda-day" data-outside>
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">quarta-feira</span><time class="eds-agenda-date" datetime="2026-04-01">1</time></div>
        </td>
        <td class="eds-agenda-day" data-outside>
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">quinta-feira</span><time class="eds-agenda-date" datetime="2026-04-02">2</time></div>
        </td>
        <td class="eds-agenda-day" data-outside>
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">sexta-feira</span><time class="eds-agenda-date" datetime="2026-04-03">3</time></div>
        </td>
        <td class="eds-agenda-day" data-outside>
          <div class="eds-agenda-day-head"><span class="eds-agenda-weekday">sábado</span><time class="eds-agenda-date" datetime="2026-04-04">4</time></div>
        </td>
      </tr>
    </tbody>
  </table>
  <p class="eds-agenda-empty">Nenhum evento neste mês.</p>
</section>

Grade montada pelo JS

Os eventos vão num JSON (HTML) ou numa prop (React) e a grade do mês é gerada a cada troca. Tente o mês seguinte: há um evento em abril.

Março de 2026

Ícones SVG abreviados aqui; a cópia traz o código completo.
<!-- Behavior: [data-eds-agenda] com os eventos num <script type="application/json" data-eds-agenda-events>.
     O JS monta a grade do mês (table, th scope="col", legenda oculta, hoje com aria-current="date" e o
     "+N mais" com Popover) e refaz a cada troca de mês. Sem o script e sem data-eds-source, o JS não reescreve
     uma grade escrita pelo servidor (veja "Mês com eventos"). Cada evento: { id, title, date, end?, time?,
     href?, tone? } com datas aaaa-mm-dd. Dados fictícios. -->
<section class="eds-agenda" aria-labelledby="ag-din-titulo" data-eds-agenda data-eds-agenda-month="2026-03" data-eds-max-events="3">
  <header class="eds-agenda-header">
    <h2 class="eds-agenda-title" id="ag-din-titulo" aria-live="polite">Março de 2026</h2>
    <div class="eds-agenda-nav">
      <button type="button" class="eds-button eds-button-secondary eds-button-sm" data-eds-agenda-today>Hoje</button>
      <button type="button" class="eds-button eds-button-ghost eds-button-icon eds-button-sm" aria-label="Mês anterior" data-eds-agenda-prev>
        <!-- ícone: svg com aria-hidden="true" -->
      </button>
      <button type="button" class="eds-button eds-button-ghost eds-button-icon eds-button-sm" aria-label="Próximo mês" data-eds-agenda-next>
        <!-- ícone: svg com aria-hidden="true" -->
      </button>
    </div>
  </header>
  <script type="application/json" data-eds-agenda-events>
    [
      { "id": "a1", "title": "Reunião de equipe", "date": "2026-03-04", "time": "09:00", "tone": "info" },
      { "id": "a2", "title": "Entrega do relatório", "date": "2026-03-04", "time": "14:00" },
      { "id": "a3", "title": "Revisão de contrato", "date": "2026-03-04", "time": "16:00", "tone": "warning" },
      { "id": "a4", "title": "Treinamento", "date": "2026-03-04", "tone": "success" },
      { "id": "a5", "title": "Congresso", "date": "2026-03-18", "end": "2026-03-20", "tone": "neutral" },
      { "id": "a6", "title": "Fechamento do mês", "date": "2026-03-31", "time": "17:00", "tone": "danger" },
      { "id": "a7", "title": "Planejamento de abril", "date": "2026-04-02", "time": "10:00", "tone": "info" }
    ]
  </script>
</section>

HTML puro

Informação: @efds-ui/behavior

Um .eds-agenda com data-eds-agenda e o mês em data-eds-agenda-month="2026-03". Há dois modos:

  • JS monta a grade: eventos num <script type="application/json" data-eds-agenda-events> ([{id, title, date, end?, time?, href?, tone?}]) ou de data-eds-source="/api/agenda?de={from}&ate={to}", consultado a cada mês. Os botões [data-eds-agenda-prev|next|today] são criados se faltarem. data-eds-week-start (0 = domingo) e data-eds-max-events (padrão 3) ajustam a grade; nomes de mês e dia seguem o locale.
  • Servidor escreve a grade (como no exemplo HTML acima) e não há dados no cliente: o JS não a reescreve, só liga os botões e avisa a troca de mês.

Eventos: eds:agenda-month-change (detail { year, month, from, to }, mês de 1 a 12) e eds:agenda-event-click (detail { id, title, date, item }).

API React

Props de Agenda
PropTipoPadrãoDescrição
eventsAgendaEvent[]—id, title, date (aaaa-mm-dd), end?, time?, href?, tone?. Só os do período visível aparecem.
month / defaultMonthstring (aaaa-mm)—Mês mostrado (controlado ou inicial). Padrão: o atual.
onMonthChange(month: string) => void—Mês anterior, próximo ou hoje. Busque os eventos do novo mês aqui.
onEventClick(event) => void—Clique num evento (link ou botão).
weekStart0 | 1 | … | 60Início da semana (0 = domingo).
maxEventsnumber3Eventos por dia antes do “+N mais”.
loadingbooleanfalsearia-busy e grade esmaecida.
localestring—Idioma dos nomes de mês e dia (padrão: o do LocaleProvider).
texts{ previous, next, today, todayMark, grid, more, moreLabel, moreTitle, allDay, empty }—Textos (pt-BR por padrão).

Classes CSS

Classes da Agenda
Classe ou atributoEfeito
section.eds-agendaA agenda; [aria-busy] esmaece a grade.
.eds-agenda-header / -title / -navCabeçalho, título (aria-live) e botões de navegação.
table.eds-agenda-gridA grade (caption oculta e th scope=col).
td.eds-agenda-day[aria-current][data-outside]Dia; hoje e dia de outro mês.
.eds-agenda-day-head / -weekday / -date / -todayCabeçalho do dia; o nome do dia e o “Hoje” só aparecem no contêiner estreito.
ul.eds-agenda-events > li > .eds-agenda-event[data-tone]Evento (a ou button); accent, neutral, info, success, warning, danger.
.eds-agenda-event-time / -titleHora e título (truncado).
.eds-agenda-moreBotão “+N mais” (popovertarget para um .eds-popover).
.eds-agenda-emptyMês sem eventos, em contêiner estreito.

Acessibilidade

  • Tabela de verdade: cabeçalhos de coluna com scope="col" e legenda oculta (“Agenda de março de 2026”). Em contêiner estreito a tabela vira lista por dia; o nome do dia da semana fica visível em cada dia.
  • Título: em aria-live="polite"; trocar de mês anuncia o novo mês.
  • Teclado: Tab percorre Hoje, anterior, próximo e os eventos; o “+N mais” abre o Popover (Esc fecha e o foco volta). O nome do botão traz a data por extenso.
  • Cor nunca sozinha: hoje tem texto e marca; eventos de dia inteiro dizem “dia inteiro” em texto oculto.