Productivity Widget
Focus tools — a pomodoro timer, a habit-streak card, a time-allocation ring panel, and a day planner.
Preview
@props([
'title' => 'Read 10 Mins',
])
<x-ui.card class="w-full max-w-[15rem] flex flex-col">
<div
x-data="{
done: false,
streak: 8,
mark() { if (!this.done) { this.done = true; this.streak++ } },
}"
class="flex flex-col gap-4 p-6"
>
<div class="flex flex-col gap-2">
<h3 class="text-lg font-medium text-foreground">{{ __($title) }}</h3>
<p class="text-sm text-muted-foreground">
{{ __('Streak') }}: <span x-text="streak">8</span> {{ __('days') }}
</p>
</div>
<div class="flex items-center justify-between">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
class="size-12 text-muted-foreground"
aria-hidden="true"
>
<path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z" />
<path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z" />
</svg>
<div>
<template x-if="!done">
<x-ui.button
variant="outline"
size="sm"
x-on:click="mark()"
aria-label="{{ __('Mark habit as done') }}"
>
{{ __('Check') }}
</x-ui.button>
</template>
<template x-if="done">
<span class="inline-flex items-center gap-2 text-sm font-medium text-success">
<span aria-hidden="true">✓</span> {{ __('Done') }}
</span>
</template>
</div>
</div>
</div>
</x-ui.card>
Installation
php artisan ui:add blocks/productivity-widget-habit
Registry contract
Install confidence
php artisan ui:add blocks/productivity-widget-habit
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/productivity-widget-habit.blade.php |
Registry dependencies
Package dependencies
composer: jml/brok:^0.2
npm: alpinejs
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.
# Brok UI block: Productivity Widget Habit (`productivity-widget-habit`)
A single-habit tracker card showing a streak count with a check button that marks the day complete.
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/productivity-widget-habit
```
## Render it
```blade
<x-blocks.productivity-widget-habit />
```
## Props
- `title` (string, default `Read 10 Mins`) — Widget title/habit name.
## Use when
- Showing a single-habit tracker card with a day-streak count and a Check button that marks today complete.
- Use when you need a lightweight daily habit check-in rather than a countdown timer or multi-task checklist.
## Avoid when
- Needing a countdown/focus timer instead of a daily check-in; use productivity-widget-pomodoro instead.
## Rules
- Render the installed block with `<x-blocks.productivity-widget-habit />` 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/productivity-widget-habit
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/productivity-widget-habit.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-habit tracker card with a day-streak count and a Check button that marks today complete.
- Use when you need a lightweight daily habit check-in rather than a countdown timer or multi-task checklist.
Avoid when
- Needing a countdown/focus timer instead of a daily check-in; use productivity-widget-pomodoro instead.
Anti-patterns
- Do not replace semantic props with conflicting utility classes.
- Do not remove labels, focus styles, or state attributes.
- Anatomy
Usage
Render the block as a component, passing data where useful:
<x-blocks.productivity-widget-habit />
Built from primitives
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.
@props([
'title' => 'Read 10 Mins',
])
<x-ui.card class="w-full max-w-[15rem] flex flex-col">
<div
x-data="{
done: false,
streak: 8,
mark() { if (!this.done) { this.done = true; this.streak++ } },
}"
class="flex flex-col gap-4 p-6"
>
<div class="flex flex-col gap-2">
<h3 class="text-lg font-medium text-foreground">{{ __($title) }}</h3>
<p class="text-sm text-muted-foreground">
{{ __('Streak') }}: <span x-text="streak">8</span> {{ __('days') }}
</p>
</div>
<div class="flex items-center justify-between">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
class="size-12 text-muted-foreground"
aria-hidden="true"
>
<path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z" />
<path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z" />
</svg>
<div>
<template x-if="!done">
<x-ui.button
variant="outline"
size="sm"
x-on:click="mark()"
aria-label="{{ __('Mark habit as done') }}"
>
{{ __('Check') }}
</x-ui.button>
</template>
<template x-if="done">
<span class="inline-flex items-center gap-2 text-sm font-medium text-success">
<span aria-hidden="true">✓</span> {{ __('Done') }}
</span>
</template>
</div>
</div>
</div>
</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