SW Shapes
The library provides 32 software and AI component shapes.
Each shape is a D2 class applied with class: <name>.
Usage
import d2
code = """
agent: Auditor { class: sw-agent }
model: Claude { class: sw-model }
tool: Search { class: sw-tool }
agent -> tool -> model
"""
svg = d2.compile(code, library="sw")
Core Software / Infrastructure
Class |
Icon |
Description |
sw-server
|
|
Server or backend service. Rack/tower silhouette. |
sw-database
|
|
Database or data store. Classic cylinder shape. |
sw-queue
|
|
Message queue or job queue. Horizontal stack with arrows. |
sw-api
|
|
API endpoint or REST service. Angle brackets with slash. |
sw-cloud
|
|
Cloud service or external SaaS. Cloud outline. |
sw-container-svc
|
|
Container or microservice. Nested box (Docker-style). |
sw-function
|
|
Serverless function or Lambda. Lambda/f(x) symbol. |
sw-cache
|
|
Cache layer (Redis, CDN). Lightning bolt symbol. |
sw-storage
|
|
Object storage or file system. Stacked file rectangles. |
sw-gateway
|
|
API gateway or load balancer. Shield with arrows. |
sw-browser
|
|
Browser or web client. Window chrome with address bar. |
sw-mobile
|
|
Mobile app client. Phone outline. |
sw-terminal
|
|
CLI or terminal interface. Prompt symbol. |
sw-config
|
|
Configuration or settings. Gear/cog icon. |
AI/ML & Agent Workflow
Class |
Icon |
Description |
sw-model
|
|
LLM or ML model. Neural network node pattern. |
sw-agent
|
|
AI agent or autonomous agent. Robot head silhouette. |
sw-prompt
|
|
Prompt or system message. Chat bubble with dots. |
sw-document
|
|
Document or seed instruction. Page with folded corner. |
sw-eval
|
|
Evaluation step or judge. Checkmark in circle. |
sw-score
|
|
Score indicator or metric. Gauge with colored dots. |
sw-tool
|
|
Tool or tool call. Wrench icon. |
sw-action
|
|
Action or step execution. Play triangle. |
sw-loop
|
|
Loop or iteration cycle. Circular refresh arrows. |
sw-branch
|
|
Decision or branch point. Diamond shape. |
sw-dataset
|
|
Dataset or training data. Table grid icon. |
sw-pipeline
|
|
Pipeline or workflow. Connected chevrons. |
Communication & Observation
Class |
Icon |
Description |
sw-message
|
|
Message or notification. Envelope icon. |
sw-log
|
|
Log or audit trail. Scrolling text icon. |
sw-metric
|
|
Metric or monitoring. Bar chart with trend line. |
sw-user
|
|
User or human-in-the-loop. Person silhouette. |
sw-team
|
|
Team or group of users. Two-person silhouette. |
sw-webhook
|
|
Webhook or callback. Hook icon. |