Skip to content

Icons

SVG icon components for use as indicators, triggers, and decorative elements. The item is the shared icon namespace; it currently ships Chevron, the one glyph the library draws as SVG (every other system glyph is mono text).

Preview

Installation

$pnpm exec dgadd add ui/icons
[Installs to]src/components/ui/icons[Item]ui/icons

dgadd is not public on npm yet. Until the first release, pack @diffgazer/add from the repository and install that tarball into this app, which is what puts dgadd on pnpm exec.

UI components require Tailwind CSS v4. Local copy mode imports src/styles/styles.css; package mode uses @diffgazer/ui CSS once packages are available.

Usage

tsx
import { Chevron } from "@/components/ui/icons";export default function ChevronDefault() {  return (    <div className="flex items-center gap-4 text-muted-foreground">      <Chevron />      <span className="text-sm font-mono">Default chevron (right, sm)</span>    </div>  );}

Examples

All Directions

Preview

Animated Toggle

Preview

API Reference

Chevron

NameTypeDefaultDescription
direction"down" | "up" | "left" | "right""right"Base direction the chevron points before any rotation.
openbooleanfalseRotates 90 degrees clockwise from the base direction. Use for expand/collapse toggles.
size"sm" | "md" | "lg""sm"Icon size token.

Accessibility

Notes

Animation

Set open={true} to rotate the chevron 90° clockwise from its base direction. Uses CSS transition-transform for smooth animation. The Animated Toggle example also renders the closed and open states side by side, so the rotation is verifiable without interacting.

Accessibility

Chevron defaults to `aria-hidden="true"` for decorative use. For a meaningful standalone icon, set `aria-hidden={false}`, `role="img"`, and an accessible name such as `aria-label`.

Reusability

Chevron is used as the default trigger indicator by Accordion, Select, and Sidebar. Installing any of these components auto-installs Icons via registryDependencies. Each supports a handle prop to customize or hide it.

Source

Install via CLI: pnpm exec dgadd add ui/icons.

Highlighted source loads after this disclosure opens. Browse the source repository.