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

_images/sw-server.svg

Server or backend service. Rack/tower silhouette.

sw-database

_images/sw-database.svg

Database or data store. Classic cylinder shape.

sw-queue

_images/sw-queue.svg

Message queue or job queue. Horizontal stack with arrows.

sw-api

_images/sw-api.svg

API endpoint or REST service. Angle brackets with slash.

sw-cloud

_images/sw-cloud.svg

Cloud service or external SaaS. Cloud outline.

sw-container-svc

_images/sw-container-svc.svg

Container or microservice. Nested box (Docker-style).

sw-function

_images/sw-function.svg

Serverless function or Lambda. Lambda/f(x) symbol.

sw-cache

_images/sw-cache.svg

Cache layer (Redis, CDN). Lightning bolt symbol.

sw-storage

_images/sw-storage.svg

Object storage or file system. Stacked file rectangles.

sw-gateway

_images/sw-gateway.svg

API gateway or load balancer. Shield with arrows.

sw-browser

_images/sw-browser.svg

Browser or web client. Window chrome with address bar.

sw-mobile

_images/sw-mobile.svg

Mobile app client. Phone outline.

sw-terminal

_images/sw-terminal.svg

CLI or terminal interface. Prompt symbol.

sw-config

_images/sw-config.svg

Configuration or settings. Gear/cog icon.

AI/ML & Agent Workflow

Class

Icon

Description

sw-model

_images/sw-model.svg

LLM or ML model. Neural network node pattern.

sw-agent

_images/sw-agent.svg

AI agent or autonomous agent. Robot head silhouette.

sw-prompt

_images/sw-prompt.svg

Prompt or system message. Chat bubble with dots.

sw-document

_images/sw-document.svg

Document or seed instruction. Page with folded corner.

sw-eval

_images/sw-eval.svg

Evaluation step or judge. Checkmark in circle.

sw-score

_images/sw-score.svg

Score indicator or metric. Gauge with colored dots.

sw-tool

_images/sw-tool.svg

Tool or tool call. Wrench icon.

sw-action

_images/sw-action.svg

Action or step execution. Play triangle.

sw-loop

_images/sw-loop.svg

Loop or iteration cycle. Circular refresh arrows.

sw-branch

_images/sw-branch.svg

Decision or branch point. Diamond shape.

sw-dataset

_images/sw-dataset.svg

Dataset or training data. Table grid icon.

sw-pipeline

_images/sw-pipeline.svg

Pipeline or workflow. Connected chevrons.

Communication & Observation

Class

Icon

Description

sw-message

_images/sw-message.svg

Message or notification. Envelope icon.

sw-log

_images/sw-log.svg

Log or audit trail. Scrolling text icon.

sw-metric

_images/sw-metric.svg

Metric or monitoring. Bar chart with trend line.

sw-user

_images/sw-user.svg

User or human-in-the-loop. Person silhouette.

sw-team

_images/sw-team.svg

Team or group of users. Two-person silhouette.

sw-webhook

_images/sw-webhook.svg

Webhook or callback. Hook icon.