Resource rules

A React block (a whole screen) in Beamline's Events & bookings app.

Each person's scheduling rules beside their day, the day board leading: role, available (an unavailable day filled in the danger tint and said, a job left on it red), may overlap, each a chip that says it and flips when pressed, and a policy not known hatched and said as not known (never as not allowed); read only locks every rule while it stays readable. A job is moved by dragging it onto someone's day, or by picking it and choosing who: where it would land is outlined on every other day, and your app checks it: accepted (the job moves, green), refused with its reason (nothing changes), or waiting for a confirmation when moves must be confirmed.

Use it for

  • Beside a schedule of people or machines whose rules decide where work can go: a workshop's crew, a field team, a studio's rooms, a fleet.
  • Where a move must say why it is refused, or wait for someone to confirm it.

Not for

Anatomy

  • header: the product's mark, the title and day, Ask before a move lands (switch), Read only (switch)
  • the day board: the hours across; each person (name, role, their rules as chips: Available / Off today, May overlap / One job at a time, Not known hatched) beside their day (jobs as tinted bars; an unavailable day filled red with its words)
  • a chosen job outlined, and where it would land outlined on every other day (firmer on the picked person's)
  • the move: Move <job> from <person> to (a person), Try the move, cancel; at rest one line on how to move; the answer in its tone (accepted success, refused danger with the reason, waiting warning with Confirm and Keep it where it is)
  • read only said under the board

States

  • available, unavailable
  • overlap allowed, overlap forbidden
  • unknown policy
  • read only
  • reasoned rejection, pending confirmation, accepted
  • a rule's save refused: put back and said
  • no people
  • phone: each person over their day, the day as wide as the screen
  • right to left: the day and the bars mirror

Keyboard

  • Tab through the switches, each person's two rule chips (Space flips), each job (Enter picks it), the person select, Try the move, Confirm

Motion

None of its own.

Props

PropTypeDefaultDescription
date (required)string—The day shown, an ISO date.
people (required)CrewMember[]—
jobs (required)CrewJob[]—
onRuleChange((personId: string, rule: "allowOverlap" | "available", value: boolean) => Promise<Crew…—Change one rule. Resolve with the person as saved; reject to keep the rule as it was (said).
onMove((jobId: string, toPersonId: string, confirmed: boolean) => Promise<MoveAnswer>)—Check a move of a job to a person. Nothing changes until it is accepted (or, when pending, confirmed).
hours[number, number]—The day's hours drawn. Default 7–19.
defaultReadOnlyboolean—
defaultConfirmboolean—
defaultMove{ jobId: string; toId: string; }—The move chosen when it opens, ready to try.
productstring—Your product's name, shown as its mark.
classNamestring—Classes on the documented visual root; no override by default.
refRef<HTMLDivElement>—Receives the documented native target or imperative handle; omitted by default.

Built from

Dependencies

lucide-react

Import

import { ResourceRules } from "@beamline/resource-rules";

Get it

Resource rules is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent

More in Events & bookings

  • Team calendar: A team's schedule: the people and shared calendars to show (each its colour), a month to jump by, who is out this week, and the week, day or month of…
  • Day agenda: One person's days with notes, tasks and calendar events side by side, each kept as what it is. A task's scheduled day, deadline, reminder and repeat are…
  • Crew booking: Booking crew for a project: each person with a strip of the project's days, days in the same state joined into one run said once (booked solid, available…
  • Resource booking: Booking something shared (a room, a van, a camera kit). Choose what, then either a free hour on a day: a grid of starts the app says are free (a taken…
  • Desk booking: Desks in an office for the people who book them and the admin who sets how far ahead. Your days over the next weeks: booked with a desk, free to book…
  • Linked appointments: A drop-off and a pickup kept as one linked pair on the week's calendar (the shared event calendar, day view on a phone), with the car's stay drawn…
  • Waitlist desk: A front desk's waitlist beside the day's book: who is waiting (filters as chips, the queue's count apart from the day's), the day's bookings and the…
  • Visitor desk: An office front desk's visitors. Invite a meeting's guests from the calendar: colleagues are shown but never invited, guests without an email are said…
  • Issued ticket: One issued event ticket at the door, led by the ticket itself: what it admits to (event and venue), when, the section, seat and who it admits, and its…
  • Itinerary: A trip's days where every event says who sees it, in words: everyone, only Ana and Ben, or hidden from Leo. The same rules give each traveller their own…
  • Trip budget: A trip's money against its plan, in the trip's own currency. The budget (set or changed in place; a refused save keeps what was typed), what's spent and…
  • Proposal payments: A travel proposal's money from the agent's side to the client's. Pricing: the price rule (markup on supplier cost, a fixed price, or net), what the…
  • Project periods: A project's time periods (build, show, teardown) on one time scale, the thing being planned: each period a bar across its days with the crew and gear…

Part of Beamline UI: polished, editable React components and complete screens for custom applications. Build your own style from any look; tokens, fonts, radii, motion; not only colours.