Primitives
StatusDot
A glanceable sensor / permission / connection indicator. With one accent on the lens, state reads from luminance + motion: on = steady, live = pulsing, off = dim.
Installation
npx @glasskit-ui/cli add status-dotInstall the SDK (it provides GlassViewport, useDpad and the stylesheet), then copy these files into your project:
npm install @glasskit-ui/react// components/lib/utils.tsimport { clsx, type ClassValue } from "clsx";import { twMerge } from "tailwind-merge";export type { ClassValue };/** * Merge class names the shadcn way: clsx joins conditionals, tailwind-merge * de-dupes conflicting Tailwind utilities so a consumer's `className` override * wins (e.g. passing `px-2` beats the component's `px-6`). Lens components are * Tailwind utilities + `--gk-*` tokens, so this de-dupe matters. */export function cn(...inputs: ClassValue[]): string { return twMerge(clsx(inputs));}/** * Accessible name from a free-form `label` prop: the label itself when it's a * plain string, otherwise undefined (a ReactNode can't become an aria-label). */export function stringLabel(label: unknown): string | undefined { return typeof label === "string" ? label : undefined;}// components/glasskit/status-dot.tsximport type { ReactNode } from "react";import { cn } from "../lib/utils";/** * <StatusDot> — a glanceable sensor / permission / connection indicator. The * lens has one accent, so state reads from luminance + motion, not a second * hue: `on` = steady accent, `live` = pulsing accent, `off` = dim. */export function StatusDot({ status = "on", label, className,}: { /** Semantic state — live pulses, off dims. */ status?: "on" | "live" | "off"; label?: ReactNode; className?: string;}) { return ( <span className={cn( "inline-flex items-center gap-2", `gk-statusdot--${status}`, className, )} > <span className="gk-statusdot__dot" /> {label != null ? ( <span className="t-caption text-muted-foreground">{label}</span> ) : null} </span> );}Usage
<StatusDot status="live" label="GPS lock" />Props
| Prop | Type | Default | Description |
|---|---|---|---|
status | "on" | "live" | "off" | "on" | Steady / pulsing / dim. |
label | ReactNode | — | Optional caption. |
ErrorState
A recoverable error screen: optional glyph, title, message, and a retry action. No red: the lens has one accent, so the failure reads from the words. Pairs with AsyncView's error slot.
Toaster
The toast / notification system, Sonner (Emil Kowalski's library) themed to the lens. Mount <Toaster> once, then fire imperatively with toast(); it handles the queue, stacking, auto-dismiss, and enter/exit motion. Top-anchored, so Screen's Cue line owns the bottom strip.