Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Car Service Calendar Block for React Aria

Three fleet vehicles in cells with an editable odometer, a service due by date or by distance whichever comes first, two bars for the time and distance used, and Mark serviced with a history.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Keep a small fleet serviced on time, with this car service tracker for React with React Aria. A hairline frame with a plus mark on each corner holds three vehicles in cells on shared hairlines. Each has an odometer you can edit, the date and distance of its last service and an interval of 12 months or 15,000 km. A service is due by date or by distance, whichever comes first, and that is worked out from the block's fixed "now", 14 October 2026: "Due in 12 days or 340 km" or "Overdue by 73 days and 320 km", with a status word and a glyph (on schedule, due soon, overdue) and two Progress bars for the time and the distance used. Mark serviced, an outline Button, sets the last service to today and the current odometer; the closed Collapsible history gains a row and the status resets. The bands are ruled by Guides. It's built from Input, Progress, Collapsible, Button and Guides, with a CSS entrance only. For fleet managers, garages and any asset with a service interval.

FAQ

How do I fill it with my vehicles?

Edit FLEET: each vehicle has a name, a plate, the last service date as ISO, its lastKm, the current odo as digits and its history of visits. INTERVAL_MONTHS and INTERVAL_KM set the interval, SOON_DAYS and SOON_KM set when a service counts as due soon. The due date and distance, the bars and the status are all worked out from them.

Which comes first, the date or the distance?

Whichever is reached first. The sentence shows both ("Due in 12 days or 340 km") so you can see the nearer one, and the status is overdue when either is past, due soon when either is within 30 days or 1,000 km, and on schedule otherwise. The bars show how much of each interval is used.

What can I do with the odometer?

Type a new reading; the distance left, the bar and the status follow at once. It cannot go below the odometer at the last service: leaving the box with a lower number puts that number back and says so in the status line.

What does Mark serviced do?

It sets the last service to the fixed "now" and to the current odometer reading, so the next service is a year or 15,000 km on, and adds a row to that vehicle's history with the note "Marked in this demo". Nothing is saved or sent. To make it real, post the visit to your maintenance system from the handler and use its response to update the vehicle.

Is it accessible?

Status is a word with a glyph, never only a color, and the due sentence says it in plain numbers. The bars are named ("Time used", "Distance used") and their figures are written beside them. The odometer has a visible label, and the history is a disclosure with a count in its name.

How does it look on a phone?

The vehicles stack in one column, each cell keeping the same order: status, the two bars, the odometer, the last service and the history. Nothing needs to scroll sideways.