Tables
Week Schedule
A weekly schedule grid: times are row headers and days are column headers, so a meeting always reads as the pair "Wednesday, 2 pm".
- table
- schedule
- calendar
- grid
Preview
Use it with AI
- 1. Copy the link.
- 2. Write to your agent in your own words and drop the link into the sentence.
- 3. The agent opens the link and installs the component from the registry.
put this in the header: https://vibeui.ru/c/table-013?lang=en
Meetings this week
| Время | Пн | Вт | Ср — сегодня | Чт | Пт |
|---|---|---|---|---|---|
| 09:00 | ПланёркаЗал 2 | ПланёркаЗал 2 | ПланёркаЗал 2 | ||
| 11:00 | Дизайн-ревьюОнлайн | ИнтервьюПереговорка | Дизайн-ревьюОнлайн | ||
| 14:00 | Груминг задачЗал 1 | ДемоБольшой зал | РетроЗал 1 | ||
| 17:00 | Час поддержкиДежурный | Час поддержкиДежурный |
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 "table-013" (Week Schedule) 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/table-013.json
Registry item: https://vibeui.ru/r/table-013.json
Installs to: components/vibeui/table-013.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 weekly schedule grid: times are row headers and days are column headers, so a meeting always reads as the pair "Wednesday, 2 pm".
A schedule grid: time down the side, days across the top, events as cards inside the cells. Zero dependencies, one file, no client JS.
## 3. How to use it
import { Table013 } from "@/components/vibeui/table-013"
<Table013
caption="Meetings this week"
today="Thu"
/>
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-table-013-* palette — do not swap it for your theme tokens
- scope="col" on days and scope="row" on times: without both axes a cell loses its coordinates
- the role="region" wrapper with tabindex=0: otherwise the wide grid cannot be scrolled from the keyboard
- the min-width on columns: a column squeezed past legibility is worse than scrolling
- the visually hidden caption: it stays the table's accessible name even when a heading is drawn beside it
- the component's own light surface: dark text disappears on the dark catalog card
## 6. You may change
- the day names through days
- the time slots and their events through slots
- the highlighted day through today
- the schedule caption through caption
## 7. Rules
- A two-hour event is drawn as two cells: there is no vertical merging here.
- An empty cell gets an aria-hidden dot — announcing "empty" in every slot is noise.
- Seven days will certainly scroll on a phone: that is a deliberate trade for legibility.
- 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/table-013.jsonhttps://vibeui.ru/r/table-013.jsonКомпонент самодостаточен: один файл, без зависимостей, палитра в переменных --vibeui-table-013-*. Серверный: хуков нет. Двумерная таблица: th scope="col" у дней и th scope="row" у времени — только так ячейка получает обе координаты в озвучке. Колонки не сжимаются (min-width), а вся сетка лежит в обёртке role="region" с tabindex=0: широкое расписание уезжает в горизонтальную прокрутку, доступную с клавиатуры. Видимый заголовок вынесен в шапку блока, а caption спрятан визуально, чтобы не дублировать текст, но остаться именем таблицы. Цвет события задаётся data-tone через одну переменную --vibeui-table-013-tone, поэтому новый оттенок — это одна строка CSS.
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 Table013Event = {
title: string
place?: string
tone?: "blue" | "green" | "amber" | "violet"
}
export type Table013Slot = {
time: string
cells: (Table013Event | null)[]
}
export type Table013Props = Omit<
ComponentPropsWithoutRef<"div">,
"children"
> & {
days?: string[]
slots?: Table013Slot[]
/** День, чья колонка подсвечена как сегодняшняя. */
today?: string
caption?: string
accent?: string
}
// Идея компонента: сетка расписания, где ось времени — заголовки строк, а
// дни — заголовки колонок, поэтому занятие всегда озвучивается парой
// «понедельник, 10:00». Ширину не сжимаем: колонки держат min-width, а
// таблица уезжает в горизонтальную прокрутку с доступом с клавиатуры.
const STYLES = `
:where([data-vibeui-block="table-013"]){
--vibeui-table-013-bg:oklch(1 0 0);
--vibeui-table-013-fg:oklch(0.24 0.014 265);
--vibeui-table-013-muted:oklch(0.56 0.014 265);
--vibeui-table-013-border:oklch(0.92 0.006 265);
--vibeui-table-013-head:oklch(0.975 0.003 265);
--vibeui-table-013-accent:oklch(0.55 0.2 262);
--vibeui-table-013-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="table-013"]{
width:100%;box-sizing:border-box;
font-family:var(--vibeui-table-013-font);color:var(--vibeui-table-013-fg);
}
[data-vibeui-block="table-013"] [data-part="shell"]{
background:var(--vibeui-table-013-bg);
border:1px solid var(--vibeui-table-013-border);border-radius:1rem;overflow:hidden;
}
[data-vibeui-block="table-013"] [data-part="head"]{
padding:0.875rem 1rem;font-size:0.9375rem;font-weight:650;
border-bottom:1px solid var(--vibeui-table-013-border);
}
[data-vibeui-block="table-013"] [data-part="scroll"]{overflow-x:auto}
[data-vibeui-block="table-013"] [data-part="scroll"]:focus-visible{
outline:2px solid var(--vibeui-table-013-accent);outline-offset:-2px;
}
[data-vibeui-block="table-013"] table{border-collapse:collapse;width:100%;font-size:0.75rem}
[data-vibeui-block="table-013"] caption{
position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);
}
[data-vibeui-block="table-013"] th,
[data-vibeui-block="table-013"] td{
border-bottom:1px solid var(--vibeui-table-013-border);
border-right:1px solid var(--vibeui-table-013-border);
padding:0.25rem;vertical-align:top;text-align:left;
}
[data-vibeui-block="table-013"] tr > :last-child{border-right:0}
[data-vibeui-block="table-013"] tbody tr:last-child th,
[data-vibeui-block="table-013"] tbody tr:last-child td{border-bottom:0}
[data-vibeui-block="table-013"] thead th{
background:var(--vibeui-table-013-head);
padding:0.5rem 0.5rem;font-weight:650;text-align:center;white-space:nowrap;
min-width:7.5rem;
}
[data-vibeui-block="table-013"] tbody th{
background:var(--vibeui-table-013-head);
padding:0.5rem;font-weight:500;color:var(--vibeui-table-013-muted);
font-variant-numeric:tabular-nums;white-space:nowrap;width:1%;
}
[data-vibeui-block="table-013"] th[data-today="true"]{
color:var(--vibeui-table-013-accent);
box-shadow:inset 0 -2px 0 var(--vibeui-table-013-accent);
}
[data-vibeui-block="table-013"] td[data-today="true"]{
background:color-mix(in oklab,var(--vibeui-table-013-accent) 5%,transparent);
}
[data-vibeui-block="table-013"] [data-part="event"]{
display:block;border-radius:0.5rem;padding:0.375rem 0.5rem;
background:color-mix(in oklab,var(--vibeui-table-013-tone) 12%,oklch(1 0 0));
border-left:3px solid var(--vibeui-table-013-tone);
--vibeui-table-013-tone:oklch(0.55 0.2 262);
}
[data-vibeui-block="table-013"] [data-tone="green"]{--vibeui-table-013-tone:oklch(0.55 0.14 155)}
[data-vibeui-block="table-013"] [data-tone="amber"]{--vibeui-table-013-tone:oklch(0.65 0.14 70)}
[data-vibeui-block="table-013"] [data-tone="violet"]{--vibeui-table-013-tone:oklch(0.55 0.17 300)}
[data-vibeui-block="table-013"] [data-part="title"]{display:block;font-weight:600;line-height:1.25}
[data-vibeui-block="table-013"] [data-part="place"]{
display:block;margin-top:0.125rem;color:var(--vibeui-table-013-muted);font-size:0.6875rem;
}
[data-vibeui-block="table-013"] [data-part="free"]{color:var(--vibeui-table-013-border)}
[data-vibeui-block="table-013"] [data-part="sr"]{
position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="table-013"] *{animation:none!important;transition:none!important}}
`
const DEFAULT_DAYS = ["Пн", "Вт", "Ср", "Чт", "Пт"]
const DEFAULT_SLOTS: Table013Slot[] = [
{
time: "09:00",
cells: [
{ title: "Планёрка", place: "Зал 2" },
null,
{ title: "Планёрка", place: "Зал 2" },
null,
{ title: "Планёрка", place: "Зал 2" },
],
},
{
time: "11:00",
cells: [
{ title: "Дизайн-ревью", place: "Онлайн", tone: "violet" },
{ title: "Интервью", place: "Переговорка", tone: "amber" },
null,
{ title: "Дизайн-ревью", place: "Онлайн", tone: "violet" },
null,
],
},
{
time: "14:00",
cells: [
null,
{ title: "Груминг задач", place: "Зал 1", tone: "green" },
{ title: "Демо", place: "Большой зал", tone: "green" },
null,
{ title: "Ретро", place: "Зал 1", tone: "green" },
],
},
{
time: "17:00",
cells: [
{ title: "Час поддержки", place: "Дежурный" },
null,
null,
{ title: "Час поддержки", place: "Дежурный" },
null,
],
},
]
/**
* Недельное расписание: время — заголовки строк, дни — заголовки колонок.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Table013({
days = DEFAULT_DAYS,
slots = DEFAULT_SLOTS,
today = "Ср",
caption = "Расписание встреч на неделю",
accent,
className,
style,
...props
}: Table013Props) {
const palette = {
...(accent ? { "--vibeui-table-013-accent": accent } : null),
...style,
} as CSSProperties
return (
<>
<style href="vibeui-table-013" precedence="medium">
{STYLES}
</style>
<div
{...props}
data-vibeui-block="table-013"
className={className}
style={palette}
>
<div data-part="shell">
<p data-part="head">{caption}</p>
<div
data-part="scroll"
role="region"
aria-label={caption}
tabIndex={0}
>
<table>
<caption>{caption}</caption>
<thead>
<tr>
<th scope="col">
<span data-part="sr">Время</span>
</th>
{days.map((day) => (
<th
key={day}
scope="col"
data-today={day === today ? "true" : undefined}
>
{day}
{day === today ? (
<span data-part="sr"> — сегодня</span>
) : null}
</th>
))}
</tr>
</thead>
<tbody>
{slots.map((slot) => (
<tr key={slot.time}>
<th scope="row">{slot.time}</th>
{days.map((day, index) => {
const event = slot.cells[index] ?? null
return (
<td
key={day}
data-today={day === today ? "true" : undefined}
>
{event ? (
<span
data-part="event"
data-tone={event.tone ?? "blue"}
>
<span data-part="title">{event.title}</span>
{event.place ? (
<span data-part="place">{event.place}</span>
) : null}
</span>
) : (
<span data-part="free" aria-hidden="true">
·
</span>
)}
</td>
)
})}
</tr>
))}
</tbody>
</table>
</div>
</div>
</div>
</>
)
}