Room Status List
A Neoconstruct room list with status badges, one inverted for open, and a disclosure for each room.
import { cn } from "cn"
import { Eyebrow } from "@/components/eyebrow/eyebrow"
import { Badge } from "@/components/ui/badge"
import {
Collapsible,
CollapsibleContent,
CollapsibleTrigger,
} from "@/components/ui/collapsible"
// The copy: change text here, not in the markup.
const COPY = {
label: "Parcel Works meeting rooms",
eyebrow: "Parcel Works / Members’ desk",
title: "Need a room?",
when: "Tuesday, November 3 · 11:20 am",
summary: "Room details",
footnote: "Book at the front desk · First 2 hours included",
} as const
const ROOMS = [
{
name: "The Print Room",
capacity: "4 people · Display + whiteboard",
status: "Open now",
variant: "success",
note: "Available until 2 pm. Includes a USB-C display, a whiteboard, and step-free access.",
},
{
name: "The Bindery",
capacity: "8 people · Video conference kit",
status: "Back at 3 pm",
variant: "neutral",
note: "Booked until 3 pm. Includes an eight-seat table, camera, speakerphone, and adjustable lighting.",
},
] as const
/** A Neoconstruct room list with status badges, one inverted for open, and a disclosure for each room. */
export default function BadgeNeoconstructRoomStatus() {
return (
<section
data-theme="neoconstruct"
aria-label={COPY.label}
className="w-full max-w-lg border-2 border-border bg-secondary-background text-foreground"
>
<header className="border-b-2 border-border bg-accent p-6 text-accent-foreground">
<Eyebrow variant="caps" className="text-current font-bold">
{COPY.eyebrow}
</Eyebrow>
<h3 className="mt-3 text-3xl font-bold tracking-tight">{COPY.title}</h3>
<p className="mt-2 text-sm">{COPY.when}</p>
</header>
<div className="divide-y-2 divide-border">
{ROOMS.map((room) => (
<div key={room.name} className="p-6">
<div className="flex flex-wrap items-center justify-between gap-3">
<h4 className="text-base font-bold">{room.name}</h4>
<Badge
data-theme="neoconstruct"
variant={null}
className={cn(
"h-auto gap-1.5 rounded-none border-2 border-border bg-accent px-3 py-1 font-heading text-xs font-normal tracking-wider text-accent-foreground uppercase",
"font-sans font-semibold tracking-normal normal-case",
room.variant === "success"
? "bg-foreground text-background"
: "bg-secondary-background text-foreground"
)}
>
{room.status}
</Badge>
</div>
<p className="mt-2 text-xs text-muted-foreground">
{room.capacity}
</p>
<Collapsible className="mt-3 text-xs leading-6">
<CollapsibleTrigger className="w-full cursor-pointer py-2 text-left font-semibold focus-visible:outline-2 focus-visible:outline-offset-4">
{COPY.summary}
</CollapsibleTrigger>
<CollapsibleContent>
<p className="mt-2">{room.note}</p>
</CollapsibleContent>
</Collapsible>
</div>
))}
</div>
<p className="border-t-2 border-border p-4 text-center text-xs">
{COPY.footnote}
</p>
</section>
)
}
import { mergeProps } from "@base-ui/react/merge-props"
import { useRender } from "@base-ui/react/use-render"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "cn"
const eyebrowVariants = cva("text-eyebrow", {
variants: {
/**
* `default` is a 14px/20px label. `icon` adds a row with a 16px icon
* and a 12px gap; put the icon first and give it `aria-hidden`.
* `mono` and `caps` are 12px/20px uppercase labels with 0.12em
* tracking, in the mono and inherited faces respectively.
*/
variant: {
default: "text-sm/5 font-medium text-eyebrow",
icon: "flex items-center gap-3 text-sm/5 font-medium [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
mono: "font-mono text-xs/5 font-medium tracking-[0.12em] uppercase",
caps: "text-xs/5 font-medium tracking-[0.12em] uppercase",
},
},
defaultVariants: { variant: "default" },
})
/**
* A short label above a heading, rendered as a `<p>` at weight 500.
* The default is 14px/20px in the kit's eyebrow color. The surrounding
* layout controls the space to the heading. Use `className` to customize
* the typography or color, and `render` to change the element.
*/
function Eyebrow({
className,
variant = "default",
render,
...props
}: useRender.ComponentProps<"p"> & VariantProps<typeof eyebrowVariants>) {
return useRender({
defaultTagName: "p",
render,
state: { slot: "eyebrow", variant },
props: mergeProps<"p">(
{ className: cn(eyebrowVariants({ variant }), className) },
props
),
})
}
export { Eyebrow, eyebrowVariants }
Installation
pnpm dlx shadcn@latest add @01orbital/badge-neoconstruct-room-statusnpx shadcn@latest add @01orbital/badge-neoconstruct-room-statusyarn dlx shadcn@latest add @01orbital/badge-neoconstruct-room-statusbunx --bun shadcn@latest add @01orbital/badge-neoconstruct-room-statusMake it yours
- Its words are in
COPYat the top ofcomponents/blocks/app/badge-neoconstruct-room-status/index.tsx: change them there, not in the markup. ROOMS, also at the top of the file, holds its lists and settings.
Built from
npm: cn. The CLI installs it for you.
Built from these parts. The CLI adds each one that is missing and won't replace a file you already have unless you choose to:
- Badge
- Collapsible
- Eyebrow
font-unbounded
The shadcn parts here are their Base UI versions, and this piece uses Base UI's API. A Radix version you already have won't work with it.
Last updated on