Calendar

Load Heatmap

A month as a load map: five saturation steps with the number inside each cell — colour alone never names a percentage.

  • calendar
  • heatmap
  • load
  • analytics

Preview

1440pxHost theme

Use it with AI

  1. 1. Copy the link.
  2. 2. Write to your agent in your own words and drop the link into the sentence.
  3. 3. The agent opens the link and installs the component from the registry.

put this in the header: https://vibeui.ru/c/calendar-007?lang=en

март 2026 г.

пнвтсрчтптсбвс
1
2345678
9101112131415
16171819202122
23242526272829
3031

СвободноЗанято

Show the full instructions

What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.

# Install and place "calendar-007" (Load Heatmap) from VibeUI

## 1. Install first — do not skip, do not recreate
Run this exact command before writing any code:
npx shadcn@latest add https://vibeui.ru/r/calendar-007.json

Registry item: https://vibeui.ru/r/calendar-007.json
Installs to: components/vibeui/calendar-007.tsx (the exact path follows this project's components.json aliases).
npm dependencies: none.
Registry dependencies: none.

Install it from the registry. Do not recreate it from the description,
do not substitute a similar component from another library, and do not
rewrite it to match the project's existing style.

## 2. What it is
A month as a load map: five saturation steps with the number inside each cell — colour alone never names a percentage.

A month heatmap: five saturation steps, numbers inside the cells, percentages in aria-label and a worded legend. Zero dependencies, one file, no client JS.

## 3. How to use it
import { Calendar007 } from "@/components/vibeui/calendar-007"

<Calendar007 year={2026} month={3} load={[0.1, 0.9, 0.4]} />

Read the installed file for the full prop list.

## 4. Where to place it
This is a small inline component. Put it exactly where the user asked,
inside the existing markup. Do not create a new page, section or
wrapper for it. If a similar control already sits in that spot,
replace it instead of adding a second one.

Placement: ___
(The user fills this line in. If it is still blank, ask where to put it
instead of guessing.)

## 5. Keep exactly as installed
- the local --vibeui-calendar-007-* palette — do not swap it for your theme tokens
- the numbers inside cells: colour alone cannot name or compare a day
- five steps instead of a continuous scale — the eye sees no more
- the percentages in aria-label: a colour map is empty to a screen reader
- the legend with the words "free" and "busy"
- colour via color-mix from the accent: the map then recolours from one variable

## 6. You may change
- year, month and the load array
- locale — the label language
- the accent through the accent prop
- the number of steps in the rounding

## 7. Rules
- The load array runs by day of month with values from 0 to 1: compute percentages upstream.
- Adjacent-month days stay empty: foreign load in this grid confuses.
- The map shows distribution, not exact figures: a totals table beside it helps.
- Do not lift the CSS variables into globals.css: the component has to stay a single file.

## 8. Verify
- it renders with no console errors;
- it looks like the preview on the VibeUI page you copied this from;
- if it does not, you changed something listed in section 5 — put it back.

For developers

npx shadcn@latest add https://vibeui.ru/r/calendar-007.json
https://vibeui.ru/r/calendar-007.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-calendar-007-*. Серверный: хуков нет. Загрузка приходит массивом чисел от 0 до 1 по дням месяца и округляется до пяти ступеней; цвет считается через color-mix от акцента. У каждой клетки есть aria-label с процентом, легенда подписана словами «свободно» и «занято».

Component source

The same file your agent installs. Here in case you would rather copy it by hand.

import type { ComponentPropsWithoutRef, CSSProperties } from "react"

export type Calendar007Props = Omit<
  ComponentPropsWithoutRef<"div">,
  "children"
> & {
  year?: number
  month?: number
  /** Загрузка по дням месяца: 0 — свободно, 1 — занято целиком. */
  load?: number[]
  locale?: string
  accent?: string
}

// Идея компонента: месяц как карта загрузки. Насыщенность клетки показывает
// занятость, но число внутри остаётся: по одному цвету процент не назвать, а
// сравнить два дня «на глаз» ошибаются все. Ступеней пять, а не непрерывная
// шкала — глаз всё равно различает не больше.
const STYLES = `
:where([data-vibeui-block="calendar-007"]){
--vibeui-calendar-007-bg:oklch(1 0 0);
--vibeui-calendar-007-fg:oklch(0.24 0.014 265);
--vibeui-calendar-007-muted:oklch(0.6 0.014 265);
--vibeui-calendar-007-border:oklch(0.91 0.006 265);
--vibeui-calendar-007-accent:oklch(0.55 0.17 265);
--vibeui-calendar-007-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="calendar-007"]{
display:flex;flex-direction:column;gap:0.625rem;
width:100%;max-width:19rem;box-sizing:border-box;padding:0.875rem;
background:var(--vibeui-calendar-007-bg);
border:1px solid var(--vibeui-calendar-007-border);border-radius:0.875rem;
color:var(--vibeui-calendar-007-fg);font-family:var(--vibeui-calendar-007-font);
}
[data-vibeui-block="calendar-007"] [data-part="title"]{font-size:0.875rem;font-weight:650}
/* Заглавная только первая буква: capitalize поднимает и «г.» в «январь 2026 г.». */
[data-vibeui-block="calendar-007"] [data-part="title"]::first-letter{text-transform:uppercase}
[data-vibeui-block="calendar-007"] table{width:100%;border-collapse:separate;border-spacing:0.1875rem;table-layout:fixed}
[data-vibeui-block="calendar-007"] th{padding:0;font-size:0.6875rem;font-weight:600;color:var(--vibeui-calendar-007-muted);text-transform:capitalize}
[data-vibeui-block="calendar-007"] td{
height:2rem;padding:0;border-radius:0.375rem;text-align:center;
font-size:0.75rem;font-variant-numeric:tabular-nums;
/* Пять ступеней вместо непрерывной шкалы: больше глаз не различает. */
background:color-mix(in oklab,var(--vibeui-calendar-007-accent) calc(var(--vibeui-calendar-007-step,0) * 22%),oklch(0.97 0.003 265));
}
[data-vibeui-block="calendar-007"] td[data-step="3"],
[data-vibeui-block="calendar-007"] td[data-step="4"]{color:oklch(0.99 0.01 265)}
[data-vibeui-block="calendar-007"] td[data-empty="true"]{background:transparent}
[data-vibeui-block="calendar-007"] [data-part="legend"]{
display:flex;align-items:center;gap:0.375rem;font-size:0.75rem;color:var(--vibeui-calendar-007-muted);
}
[data-vibeui-block="calendar-007"] [data-part="scale"]{display:flex;gap:0.125rem}
[data-vibeui-block="calendar-007"] [data-part="scale"] i{
width:0.875rem;height:0.6875rem;border-radius:0.1875rem;
background:color-mix(in oklab,var(--vibeui-calendar-007-accent) calc(var(--vibeui-calendar-007-step,0) * 22%),oklch(0.97 0.003 265));
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="calendar-007"] *{animation:none!important;transition:none!important}}
`

const DAY = 86400000

function mondayIndex(date: Date) {
  return (date.getDay() + 6) % 7
}

const DEFAULT_LOAD = [
  0.1, 0.2, 0.9, 0.4, 0.6, 0, 0, 0.3, 0.5, 1, 0.8, 0.2, 0, 0, 0.7, 0.9, 0.95,
  0.5, 0.3, 0, 0, 0.4, 0.6, 0.2, 0.1, 0.8, 0, 0, 0.5, 0.7, 0.3,
]

/**
 * Месяц как карта загрузки: ступени насыщенности и числа внутри клеток.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Calendar007({
  year = 2026,
  month = 3,
  load = DEFAULT_LOAD,
  locale = "ru-RU",
  accent,
  className,
  style,
  ...props
}: Calendar007Props) {
  const first = new Date(year, month - 1, 1)
  const start = new Date(first.getTime() - mondayIndex(first) * DAY)
  const cells = Array.from(
    { length: 42 },
    (_, index) => new Date(start.getTime() + index * DAY),
  )

  const week = new Intl.DateTimeFormat(locale, { weekday: "short" })
  const title = new Intl.DateTimeFormat(locale, {
    month: "long",
    year: "numeric",
  }).format(first)

  const palette = {
    ...(accent ? { "--vibeui-calendar-007-accent": accent } : null),
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-calendar-007" precedence="medium">
        {STYLES}
      </style>
      <div
        {...props}
        data-vibeui-block="calendar-007"
        className={className}
        style={palette}
      >
        <p data-part="title">{title}</p>
        <table>
          <thead>
            <tr>
              {cells.slice(0, 7).map((date) => (
                <th key={date.toISOString()} scope="col">
                  {week.format(date)}
                </th>
              ))}
            </tr>
          </thead>
          <tbody>
            {Array.from({ length: 6 }, (_, row) => (
              <tr key={row}>
                {cells.slice(row * 7, row * 7 + 7).map((date) => {
                  const outside = date.getMonth() !== month - 1
                  const value = outside ? 0 : (load[date.getDate() - 1] ?? 0)
                  const step = Math.round(value * 4)

                  return (
                    <td
                      key={date.toISOString()}
                      data-empty={outside}
                      data-step={step}
                      style={
                        { "--vibeui-calendar-007-step": step } as CSSProperties
                      }
                      aria-label={
                        outside
                          ? undefined
                          : `${date.getDate()} число, загрузка ${Math.round(value * 100)}%`
                      }
                    >
                      {outside ? "" : date.getDate()}
                    </td>
                  )
                })}
              </tr>
            ))}
          </tbody>
        </table>
        <p data-part="legend">
          Свободно
          <span data-part="scale" aria-hidden="true">
            {[0, 1, 2, 3, 4].map((step) => (
              <i
                key={step}
                style={{ "--vibeui-calendar-007-step": step } as CSSProperties}
              />
            ))}
          </span>
          Занято
        </p>
      </div>
    </>
  )
}