# Timesheet

> A week of hours per project and day with row, day and week totals; weekends are shaded.

Component · CRM · Pro kit · [Live page](https://ui.twentyfirst.media/pro/components/Timesheet/)

A week of hours per project and day with row, day and week totals; weekends are shaded.

- `onChange(rowId, day, hours)` turns every cell into a number input (quarter hours).
- `target` marks weekday totals below it, in colour and in words for screen readers.

## Example

```tsx
import * as React from "react";
import { Panel, Timesheet } from "@twentyfirstmedia/pro";
import { WEEK } from "./_sales";

export default function Preview() {
  const [rows, setRows] = React.useState(WEEK);
  return (
    <Panel title="Week 47" subtitle="Nov 16 to 22, 2026">
      <Timesheet
        rows={rows}
        weekStart={new Date(2026, 10, 16)}
        target={8}
        onChange={(id, day, hours) =>
          setRows((all) =>
            all.map((r) =>
              r.id === id ? { ...r, hours: r.hours.map((h, i) => (i === day ? hours : h)) } : r,
            ),
          )
        }
      />
    </Panel>
  );
}
```

## Props

### Timesheet

| Prop | Type | Notes |
| --- | --- | --- |
| `rows` | `TimesheetRow[]` | Required |
| `weekStart` | `Date \| string \| number` | The Monday of the week. |
| `onChange?` | `(rowId: string, day: number, hours: number) => void` | Makes each cell an input. |
| `target?` | `number` | Hours a day should reach; day totals below it are marked. |
| `label?` | `string` | Accessible name (default "Timesheet"). |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### Panel

| Prop | Type | Notes |
| --- | --- | --- |
| `side?` | `boolean` |  |
| `title?` | `string` |  |
| `subtitle?` | `string` |  |
| `action?` | `ReactNode` |  |
| `children?` | `ReactNode` |  |
| `surface?` | `Surface` | `"glass"`: translucent glass over what is behind (maps, 3D, video, photos); `"solid"` opts out inside a glass `UIProvider`. |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |
