npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@llmbench/ui

v1.0.1

Published

UI component library for LLMBench dashboard

Downloads

741

Readme

@llmbench/ui

React component library for the LLMBench web dashboard.

npm version License


Shared React components used by the LLMBench web dashboard. Built with Tailwind CSS and class-variance-authority (CVA) for variant-based styling.

Installation

npm install @llmbench/ui

Peer dependency: react >= 19.0.0

Setup

Import the global CSS in your app's entry point:

import "@llmbench/ui/globals.css";

Components

Button

import { Button } from "@llmbench/ui";

// Variants: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link"
// Sizes: "default" | "sm" | "lg" | "icon"

<Button variant="default" size="default">Run Evaluation</Button>
<Button variant="destructive" size="sm">Delete Run</Button>
<Button variant="outline">Export Results</Button>
<Button variant="ghost" size="icon"><TrashIcon /></Button>
<Button variant="link">View Documentation</Button>

// Supports all HTML button attributes
<Button disabled onClick={() => runEval()}>Processing...</Button>

Card

Compound component for content containers:

import { Card, CardHeader, CardTitle, CardDescription, CardContent } from "@llmbench/ui";

<Card>
  <CardHeader>
    <CardTitle>Evaluation Run #42</CardTitle>
    <CardDescription>GPT-4o vs Claude Sonnet on QA tasks</CardDescription>
  </CardHeader>
  <CardContent>
    <p>Completed 150/150 test cases</p>
    <p>Average score: 0.87</p>
  </CardContent>
</Card>

Badge

import { Badge } from "@llmbench/ui";

// Variants: "default" | "secondary" | "destructive" | "outline" | "success" | "warning"

<Badge variant="success">Completed</Badge>
<Badge variant="destructive">Failed</Badge>
<Badge variant="warning">Running</Badge>
<Badge variant="outline">Pending</Badge>
<Badge variant="secondary">Draft</Badge>

ScoreBadge

Automatically selects a color variant based on the score value:

import { ScoreBadge } from "@llmbench/ui";

<ScoreBadge score={0.95} />                    // Green: "95%"
<ScoreBadge score={0.65} label="Accuracy" />   // Yellow: "Accuracy: 65%"
<ScoreBadge score={0.30} />                    // Red: "30%"

// Thresholds:
//   >= 0.8 → success (green)
//   >= 0.5 → warning (yellow)
//   <  0.5 → destructive (red)

CostDisplay

Formats USD costs with intelligent decimal precision:

import { CostDisplay } from "@llmbench/ui";

<CostDisplay cost={1.50} />      // "$1.50"     (>= $1: 2 decimals)
<CostDisplay cost={0.0123} />    // "$0.0123"   (< $1: 4 decimals)
<CostDisplay cost={0.000001} />  // "$0.000001" (< $0.01: 6 decimals)

<CostDisplay cost={0.05} className="text-red-500" />

Dialog

Modal dialog built on Radix UI primitives:

import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from "@llmbench/ui";

<Dialog open={open} onOpenChange={setOpen}>
  <DialogContent>
    <DialogHeader>
      <DialogTitle>Create Project</DialogTitle>
      <DialogDescription>Add a new evaluation project.</DialogDescription>
    </DialogHeader>
    {/* form content */}
    <DialogFooter>
      <Button onClick={() => setOpen(false)}>Cancel</Button>
      <Button onClick={handleCreate}>Create</Button>
    </DialogFooter>
  </DialogContent>
</Dialog>

ConfirmDialog

Pre-built confirmation dialog with loading and error states:

import { ConfirmDialog } from "@llmbench/ui";

<ConfirmDialog
  open={open}
  onOpenChange={setOpen}
  title="Delete Run"
  description="This will permanently delete this evaluation run."
  onConfirm={() => deleteMutation.mutate(runId)}
  loading={deleteMutation.isPending}
  error={errorMessage}
/>

Form Components

import { Input, Label, Select, Textarea } from "@llmbench/ui";

<Label htmlFor="name">Project Name</Label>
<Input id="name" placeholder="my-project" />
<Textarea placeholder="Description..." />
<Select value={value} onChange={handleChange}>
  <option value="openai">OpenAI</option>
</Select>

Utilities

cn — Class Name Merger

Combines clsx and tailwind-merge for intelligent Tailwind class merging:

import { cn } from "@llmbench/ui";

cn("px-4 py-2", "px-6");           // "px-6 py-2" (px-4 overridden)
cn("text-red-500", isActive && "text-blue-500"); // conditional classes
cn("base-class", className);       // merge with external className prop

Variant References

buttonVariants

import { buttonVariants } from "@llmbench/ui";

// Use as a className generator (e.g., for links styled as buttons)
<a className={buttonVariants({ variant: "outline", size: "sm" })}>
  View Report
</a>

badgeVariants

import { badgeVariants } from "@llmbench/ui";

<span className={badgeVariants({ variant: "success" })}>
  Active
</span>

All Exports

| Export | Type | Description | |--------|------|-------------| | Button | Component | Multi-variant button | | buttonVariants | CVA | Button class generator | | ButtonProps | Type | Button prop types | | Card | Component | Container root | | CardHeader | Component | Card header section | | CardTitle | Component | Card title text | | CardDescription | Component | Card subtitle text | | CardContent | Component | Card body section | | Badge | Component | Multi-variant badge | | badgeVariants | CVA | Badge class generator | | BadgeProps | Type | Badge prop types | | Dialog | Component | Modal dialog root | | DialogContent | Component | Dialog content container | | DialogHeader | Component | Dialog header section | | DialogTitle | Component | Dialog title text | | DialogDescription | Component | Dialog description text | | DialogFooter | Component | Dialog footer section | | ConfirmDialog | Component | Pre-built confirmation dialog | | ConfirmDialogProps | Type | ConfirmDialog prop types | | Input | Component | Text input field | | Label | Component | Form label | | Select | Component | Select dropdown | | Textarea | Component | Multi-line text input | | ScoreBadge | Component | Auto-colored score display | | CostDisplay | Component | USD cost formatter | | cn | Utility | Tailwind class merger |

Related Packages

| Package | Description | |---------|-------------| | @llmbench/cli | CLI tool (includes llmbench serve to launch the dashboard) | | @llmbench/core | Evaluation engine, providers, and scorers | | @llmbench/types | TypeScript type definitions |

License

Apache License 2.0