Skip to content
Brok UI

Loading…

No results

Calendar Widget

Open source

Decorative calendar cards — a per-day pricing grid, a week picker with tasks, and a day agenda with accent bars.

Preview

resources/views/blocks/calendar-widget-agenda.blade.php Blade
@props([
    'date'    => '9',
    'dayName' => 'Tuesday',
    'month'   => 'June',
    'events'  => null,
])

@php
    $events ??= [
        ['title' => 'Apartment cleaning', 'time' => '9:00 - 10:00 AM', 'accent' => 'bg-primary', 'category' => 'home'],
        ['title' => 'Pickleball', 'time' => '11:00 - 1:00 PM', 'accent' => 'bg-info', 'category' => 'sport'],
        ['title' => 'Design new widgets', 'time' => '1:45 - 3:45 PM', 'accent' => 'bg-success', 'category' => 'work'],
    ];
@endphp

<x-ui.card class="w-full max-w-sm flex flex-col gap-4 p-4">
    <div class="flex items-center justify-between gap-4">
        <div class="flex items-center gap-x-4">
            <h3 class="text-5xl font-semibold leading-none text-foreground">{{ $date }}</h3>
            <div class="flex flex-col items-start justify-center gap-2">
                <span class="text-xl text-foreground">{{ $dayName }}</span>
                <span class="text-base text-muted-foreground">{{ $month }}</span>
            </div>
        </div>
    </div>

    <ul class="flex flex-col gap-4">
        @foreach ($events as $event)
            <li class="flex items-center justify-between gap-4">
                <div class="flex items-stretch gap-4">
                    <span class="w-1 shrink-0 rounded-full {{ $event['accent'] }}" aria-hidden="true"></span>
                    <div class="space-y-0.5">
                        <p class="text-base text-foreground">{{ $event['title'] }}</p>
                        <p class="text-base text-muted-foreground">{{ $event['time'] }}</p>
                    </div>
                </div>
                <x-ui.badge variant="secondary">{{ $event['category'] }}</x-ui.badge>
            </li>
        @endforeach
    </ul>

    <x-ui.button variant="outline" size="sm" class="mt-2 self-start">
        <svg class="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
            <path d="M5 12h14" />
            <path d="M12 5v14" />
        </svg>
        {{ __('Add Event') }}
    </x-ui.button>
</x-ui.card>

Installation

terminal
php artisan ui:add blocks/calendar-widget-agenda

Installs these dependencies automatically:

Registry contract

Install confidence

php artisan ui:add blocks/calendar-widget-agenda writes only the generated targets below. The CLI validates each file hash before writing and prompts before replacing local changes unless --force is used.

Version
1.0.3
License
open
Stability
stable
Contract
v1
Foundation
≥ 1.0.0
Type Generated target
blade resources/views/blocks/calendar-widget-agenda.blade.php

Registry dependencies

card badge button

Package dependencies

composer: jml/brok:^0.2

Use with AI

A brief for your coding agent: what the block is, the install command, how to render it, its props and the rules. Copy it, or open a prompt about this block in an assistant.

calendar-widget-agenda.md
# Brok UI block: Calendar Widget Agenda (`calendar-widget-agenda`)

A day-agenda calendar widget with a large date heading and an event list using coloured accent bars and category badges.

Brok UI is a Laravel Blade registry. `ui:add` copies this block into the app as plain Blade the app owns; it composes installed `<brok:*>` primitives and semantic design tokens.

## Install

```bash
php artisan ui:add blocks/calendar-widget-agenda
```

## Render it

```blade
<x-blocks.calendar-widget-agenda />
```

## Props

- `date` (string, default `9`)
- `day-name` (string, default `Tuesday`)
- `month` (string, default `June`)
- `events` (mixed|null, default `null`)

## Use when

- Showing a single day's agenda as a large date heading above an event list with coloured accent bars and category badges.
- Keeping the widget focused on one day rather than a month grid or week strip.

## Avoid when

- Use calendar-widget-pricing for a month grid or calendar-widget-week for a week strip with a task list instead of a single day.

## Rules

- Render the installed block with `<x-blocks.calendar-widget-agenda />` and pass data through its props; edit the copied file only for structural changes.
- Keep the semantic design tokens (`bg-background`, `text-muted-foreground`); never swap in raw colour utilities.
- Keep the `data-slot` attributes and the logical (start/end) spacing so the markup still mirrors under `dir="rtl"`.

## Links

- Docs: https://brokui.dev/blocks/calendar-widget-agenda
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/calendar-widget-agenda.json

Working in Claude Code, Cursor or Codex? Give the agent the whole registry through the MCP server or the Brok UI skill.

Guidance

Use when

  • Showing a single day's agenda as a large date heading above an event list with coloured accent bars and category badges.
  • Keeping the widget focused on one day rather than a month grid or week strip.

Avoid when

  • Use calendar-widget-pricing for a month grid or calendar-widget-week for a week strip with a task list instead of a single day.

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.

Usage

Render the block as a component, passing data where useful:

resources/views/welcome.blade.php Blade
<x-blocks.calendar-widget-agenda />

Built from primitives

Composes <brok:*> Semantic tokens Re-themeable RTL-ready

This block composes installed <brok:*> primitives and semantic design tokens only — it does not reimplement any primitive. Re-theme it (light, dark, admin, customer) by editing CSS variables; flip the preview to RTL to confirm it mirrors.

Source

The exact, editable file ui:add writes into your app. The preview above renders this same source — there are no preview-only blocks.

resources/views/blocks/calendar-widget-agenda.blade.php Blade
@props([
    'date'    => '9',
    'dayName' => 'Tuesday',
    'month'   => 'June',
    'events'  => null,
])

@php
    $events ??= [
        ['title' => 'Apartment cleaning', 'time' => '9:00 - 10:00 AM', 'accent' => 'bg-primary', 'category' => 'home'],
        ['title' => 'Pickleball', 'time' => '11:00 - 1:00 PM', 'accent' => 'bg-info', 'category' => 'sport'],
        ['title' => 'Design new widgets', 'time' => '1:45 - 3:45 PM', 'accent' => 'bg-success', 'category' => 'work'],
    ];
@endphp

<x-ui.card class="w-full max-w-sm flex flex-col gap-4 p-4">
    <div class="flex items-center justify-between gap-4">
        <div class="flex items-center gap-x-4">
            <h3 class="text-5xl font-semibold leading-none text-foreground">{{ $date }}</h3>
            <div class="flex flex-col items-start justify-center gap-2">
                <span class="text-xl text-foreground">{{ $dayName }}</span>
                <span class="text-base text-muted-foreground">{{ $month }}</span>
            </div>
        </div>
    </div>

    <ul class="flex flex-col gap-4">
        @foreach ($events as $event)
            <li class="flex items-center justify-between gap-4">
                <div class="flex items-stretch gap-4">
                    <span class="w-1 shrink-0 rounded-full {{ $event['accent'] }}" aria-hidden="true"></span>
                    <div class="space-y-0.5">
                        <p class="text-base text-foreground">{{ $event['title'] }}</p>
                        <p class="text-base text-muted-foreground">{{ $event['time'] }}</p>
                    </div>
                </div>
                <x-ui.badge variant="secondary">{{ $event['category'] }}</x-ui.badge>
            </li>
        @endforeach
    </ul>

    <x-ui.button variant="outline" size="sm" class="mt-2 self-start">
        <svg class="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
            <path d="M5 12h14" />
            <path d="M12 5v14" />
        </svg>
        {{ __('Add Event') }}
    </x-ui.button>
</x-ui.card>

Ownership & lifecycle

Owner, release state, review evidence and adoption for this item.
Owner
Platform UI (@JoshJML)
Current version
1.0.3
Status
Stable
License
open
Deprecation
Not deprecated
Contract
v1
Foundation
≥ 1.0.0