COMPONENTS/OVERLAYS

Sheet.

A little space beside your work.

In practice

Make yourself at home.

Your workspace, your preferences.

Uses the dialog primitive for focus management. Include SheetTitle, SheetDescription and an explicit action.

Installation

Install Coal once. Components and TypeScript declarations are included. React 19 and React DOM 19 are peer dependencies.

Terminal · local package
npm install http://localhost:3100/downloads/chlohal-coal-ui-0.5.0.tgz

This installs the local package. It is not yet published on npm. See installation for stylesheet setup and integration.

Usage

example.tsx
"use client";
import * as React from "react";
import "@chlohal/coal-ui/styles.css";
import { SlidersHorizontal } from "lucide-react";
import { Button, Switch, SwitchThumb, Sheet, SheetTrigger, SheetContent, SheetTitle, SheetDescription, SheetClose } from "@chlohal/coal-ui";
export default function Example() {
    return (<Sheet>
          <SheetTrigger render={<Button variant="outline"/>}>
            <SlidersHorizontal />
            Workspace settings
          </SheetTrigger>
          <SheetContent>
            <SheetTitle>
              Make yourself at home.
            </SheetTitle>
            <SheetDescription>
              Your workspace, your preferences.
            </SheetDescription>
            <div>
              <label>Notifications<Switch defaultChecked><SwitchThumb /></Switch></label>
            </div>
            <SheetClose render={<Button />}>Done</SheetClose>
          </SheetContent>
        </Sheet>);
}

Source

The original Coal implementation. Use the package export to integrate it.

packages/react/src/sheet.tsx
"use client";
import * as React from "react";
import { DialogContent } from "./dialog.js";
import { cn } from "./internal.js";
export {
  Dialog as Sheet,
  DialogTrigger as SheetTrigger,
  DialogTitle as SheetTitle,
  DialogDescription as SheetDescription,
  DialogClose as SheetClose,
} from "./dialog.js";
export function SheetContent({
  className,
  ...props
}: React.ComponentPropsWithRef<typeof DialogContent>) {
  return <DialogContent className={cn("coal-sheet", className)} {...props} />;
}

Accessibility checklist

  • Provide an accessible name for controls, including icon-only buttons.
  • Check keyboard navigation, visible focus and disabled states in your application.
  • Do not rely on color alone to communicate status.