In this guide
MODEL CLASSES AND CONTRACTS
Class Diagram guide
Build classes visually. Define members and relationships, review model checks, organize packages, and save or export your diagram.
Design classes and their responsibilities
Class Diagram is a separate visual workspace for classes, abstract classes, interfaces, and enumerations. Each classifier has a name, an attribute or literal compartment, and an operation compartment. Abstract names are italicized; interfaces and enumerations show their stereotype. Select a class and use Header color to choose a preset, a custom color, or Neutral. Header colors are saved, support Undo/Redo, and appear in image exports; member text stays readable.
New diagrams ask you to choose Blank diagram or Order system template. New diagrams remain in memory until saved to cloud or downloaded as JSON. Its compact editor bar contains the diagram name, File menu, Undo/Redo, theme control, and image export. Class Diagram cloud files are separate from SQL, Prisma, and ERD Builder documents.
Build your first class diagram
- Open Class Diagram and choose Blank diagram or Order system template. File → New diagram opens the chooser again; File → Blank replaces the current diagram with confirmation and Undo.
- Click Class or drag it from the Library onto the canvas, then rename it Customer in the inspector (use Edit details on a narrow screen), and add an id attribute with visibility Private (-) and type UUID.
- For a custom classifier, choose Custom classifier or edit the optional Stereotype field on any existing classifier. Tags such as entity, service, or controller appear as «your tag» above the name and are included in cloud files, JSON and image exports. They retain the selected base classifier behavior; the tool does not validate UML profiles.
- Add another class named Order. Add an operation such as calculateTotal with return type Decimal. Guided fields show a preview before you commit.
- Choose Association from the relationship Library. From starts with the selected class when one is selected. Set From to Customer and To to Order, then create it. Select the connector to add a label and multiplicities.
- To create both items together, select a class and choose Connect new. Add connected class lets you choose the new classifier, optional name, relationship and direction. Inheritance and realization initially point the new child or implementer to the selected parent or contract; other types initially point from the selected class to the new one. Create connected class commits both in one undo step; Cancel or Escape discards the form.
- Use Arrange and Fit diagram, then download JSON from File for an editable backup or Export diagram for PNG, JPEG, WebP, vector SVG, or PDF.
Attributes, literals, and visibility
Select a classifier and use Fields to add an attribute with a name, required type, visibility, and optional default value. Type suggestions include common types and classifier names; custom types are allowed. Add or Save changes commits the preview in one edit. Cancel or Escape discards the pending form.
Use + for public, - for private, # for protected, and ~ for package visibility. Text mode accepts one member per line. Format tidies supported valid signatures only; custom notation remains text and is preserved when another row changes.
Enumerations use Literals in place of Attributes. Enter a literal name and an optional value, for example ACTIVE = "active". Guided fields reject repeated member names. Custom text is preserved even when it cannot be represented in fields.
- id: UUID
+ displayName: String
# active: Boolean = true
~ tags: List<String> = []Operations and typed parameters
An operation has visibility, a name, typed parameters with optional defaults, and an optional return type. Add parameter inserts an input row; its remove button deletes that pending parameter. New operations default to return type void.
In Text mode, write name(parameter: Type): ReturnType, with an optional visibility prefix. Nested generic types and quoted defaults are supported. Each parameter needs a distinct name and a type. Overloads may share an operation name when their parameter types differ.
+ placeOrder(items: List<OrderItem>): Order
+ findOrders(status: String = "open"): List<Order>
- calculateTotal(): DecimalChoose the relationship notation
Hover or keyboard-focus a class (tap to select on touchscreens) to reveal its connection points, then drag to another class for an association. Points stay hidden at rest and in read-only diagrams. You can also choose a relationship from the Library. The inspector lets you change type, endpoints, label, and endpoint multiplicities such as 1, 0..1, or 0..*. Multiplicities are editable text; the tool does not infer business rules.
Each multiplicity has 1, 0..1, 0..*, and 1..* presets. Custom text remains editable and is preserved. Relationship meaning explains the actual direction, parent/contract or whole/part, and association counts: To multiplicity counts To instances per From; From multiplicity counts the reverse. Guidance does not add semantic validation.
Relationship names sit directly on the connector near its midpoint. Multiplicities stay near their own class boundary and clear the UML heads. Labels follow live dragging, then settle against other labels when released. Long text wraps; crowded routes may need a clear fallback if the label cannot fit on the line.
Roles and navigation adds optional From role and To role beside the relevant class. Different roles or labels distinguish parallel structural links, such as billingAddress and shippingAddress. Association navigation can point to From, To or both. Other relationship types keep their semantic heads.
The tool rejects missing endpoints, exact same-direction/type/label/structural-role duplicates, inheritance cycles, and self inheritance or realization. Multiplicity, navigation and path changes alone do not make a distinct link. Association, aggregation, composition and dependency may connect a class to itself. These structural checks do not establish complete UML semantic validity.
| Relationship | Direction and symbol |
|---|---|
| Association | Line between associated classifiers; optional navigation arrows point to a reachable class. Recursive links are supported. |
| Inheritance | From is the subclass. A solid line ends in a hollow triangle at To, the parent. |
| Realization | From implements the contract at To. A dashed line ends in a hollow triangle at To. |
| Aggregation | From is the whole and To is the part. A hollow diamond belongs to From. |
| Composition | From owns the lifetime of To. A filled diamond belongs to From. |
| Dependency | From depends on To. A dashed open arrow points to the supplier at To. |
Automatic sides, fixed heads, and paths
Curved is the default for a fresh diagram. View → Connection paths in the canvas toolbar offers Curved and Elbow to set all paths and the default for new connections. Elbow uses horizontal and vertical segments with small rounded corners. Select a connector to override its Line path individually.
New connections choose suitable sides automatically as classes move or resize. Left and Right connections attach at the header. Top and Bottom attach at the corresponding card boundary. Choosing Top, Bottom, Left, or Right in the inspector fixes only that endpoint; its partner can continue following automatically.
Use the endpoint’s Auto button to release its fixed side, or Auto sides to release both. Selected connectors also expose draggable heads: drag around the class for a preview and release to commit. Escape cancels a preview; arrow keys on a focused head choose a side.
Paths avoid their connected cards; recursive links loop outside the class, and parallel links use separate routes. Arrangement and automatic sides improve readability but do not guarantee avoidance of every unrelated card or other connection. Older JSON drafts without side modes preserve their saved sides until you choose Auto.
Check your model and rename safely
Checks opens Errors, Warnings and Suggestions for member notation, names, multiplicity bounds and inheritance structure. Select an issue to reveal its class or relationship and the relevant field. Checks preserve custom text, never auto-fix, and do not act as a programming-language compiler.
Rename with references… in a selected class previews exact type references in attributes, operation parameters and return types. Choose the references to update, then apply the name and references as one undo step. Custom notation, defaults, qualified external types and ambiguous references to repeated classifier names remain unchanged.
Selected type replacements must fit the 8,000-character limit of each member compartment. If a proposed update would exceed it, deselect some references or clear all reference selections to rename only the class. The tool rejects the oversized update rather than truncating member text.
Align, distribute, and lock classes
Layout offers selected-class alignment, equal horizontal/vertical gaps, Arrange selection, position locks and a Snap to alignment guides toggle. Ctrl/Cmd-click to select classes. Locked classes remain fixed during drag, package movement and arrangement; locks survive saves. Equal gaps preserve outer classes and leave crowded spans unchanged. Selection arrangement leaves other classes fixed and places its block clear of them, or keeps the graph intact if no placement fits. Single-class drags snap within six screen pixels; guides and their toggle stay outside saved files.
Arrange and navigate the canvas
Click Arrange for Smart arrangement. It uses class sizes and relationship structure, places parents and interfaces above children, and separates disconnected groups. The dropdown also offers Left to right, Top to bottom, and Compact.
Arrangement preserves relationship meaning and fixed endpoint sides, updates automatic sides, and fits the result. Undo reverses it in one step. If the document changes while the layout engine loads, the stale result is discarded; arrange again for the new document.
Large layouts move together within saved position limits. If an arrangement cannot fit, your diagram stays intact; try Names only or another direction, then arrange again.
Drag classes to position them, drag empty canvas to pan, and scroll to zoom. Fit diagram and the zoom controls help navigate; the minimap shows an overview. At widths up to 900px, the inspector moves below the canvas. Select a class or connection and choose Edit details (View details for a shared file) to reach it; Back to diagram returns to the canvas. Choosing a relationship opens its form in view. The class diagram guide opens in a separate tab so the current draft stays open.
Find or Ctrl/Cmd+K searches names, stereotypes, attributes, operations, package names, and notes. Use Arrow Up/Down and Enter to select and center a result; member results reveal that class’s full details and focus its matching inspector section. Escape closes Find. Focus connections emphasizes the selected class and immediate neighbors while dimming unrelated elements; Show all or Escape exits focus.
Open View in the canvas toolbar to choose Full details, Attributes only, or Names only. Attributes only keeps attributes or enumeration literals and summarizes operations; Names only shows member counts. Hover, focus, or select a class to override its detail level, or choose Diagram default to inherit. Changing the global level clears overrides. Focus and details also work in shared files, stay outside saved documents and Undo/Redo, and do not change member text. Images follow the selected detail level; JSON and cloud files retain full members.
Hold Ctrl/Cmd while clicking to select a group. The compact selection toolbar exposes Focus, Duplicate, and Connect new when applicable; More selection actions contains Copy selection, Create package, and Delete selection. Mobile Edit details or View details still opens the inspector. Duplicate selection creates an offset copy; Copy selection and Paste can transfer classes or notes between class diagrams when browser clipboard access is available. An in-memory copy supports Paste within the workspace. Copies receive new IDs and unused names, preserve group offsets and internal relationships, and include a package only when all its classes are copied. Selecting a package copies all its members. A duplicate or paste is one undo step; text fields keep native copy/paste behavior.
Add notes and group classes in packages
Note — Add a comment creates a note and focuses Note text in the inspector; an empty canvas note says Write a note…. Attach note to links it to a class or relationship with a dashed tether; the note stays where placed while the tether tracks the target. Deleting the target detaches the note and keeps its text. Long notes wrap into a bounded preview; complete text remains editable.
Package — Group classes groups selected classes immediately. With none selected, choose members and an optional Package name, then Create package. Each class belongs to one package at most. Drag its header to move the members together unless a member is position-locked. Ungroup classes removes only the frame. Use the header chevron or inspector to collapse a package into a class count with external connections. Find and Checks expand packages to reveal members. Packages remain visual groups, not namespaces or semantic relationship endpoints. Collapse is view-only: JSON/cloud retain all members and links; images match the displayed view.
Cloud files, portable JSON, and images
File → Export PlantUML previews editable source and offers Copy text or Download .puml. It exports full members, kinds, stereotypes, colors, roles/navigation/multiplicities, packages and notes locally. PlantUML chooses its own layout, so canvas positions, fixed sides, position locks and collapsed views are not exported. Use JSON to preserve the complete editable diagram. PlantUML import is not available.
Class Diagram does not save diagrams in browser storage. New diagrams remain in memory. Save (Ctrl/Cmd+S) signs in when needed and creates or updates an independent class diagram cloud file. File → Open class diagrams opens its own searchable file list. File → Share class diagram controls public access; viewers can inspect and export but cannot edit. Unsaved diagrams prompt before leaving or reloading. Download JSON from File to keep an editable copy, and use Import JSON to reopen an exported version 1 Erd Go class diagram file. Imports are validated before replacement.
Blank, Example, and Import ask before replacing a nonempty diagram and support Undo. Export diagram offers PNG, JPEG, WebP, standalone vector SVG, and image-backed PDF on white. Capture the entire diagram (default), including offscreen classes, or the current view. HD, 2K, and 4K presets preserve proportions within 8192px per side and 16 megapixels; vector SVG scales freely. Keep JSON or a cloud file for further diagram editing.
Optional notes and packages extend the existing version 1 format; older files still open without them. Limits are 200 classifiers, 600 relationships, 100 notes of up to 2,000 characters, 50 packages, 8,000 characters per member compartment, a 32 MB imported JSON file, and a 1.5 MB cloud file. Cloud file names must contain 3–259 characters. Save to cloud or download JSON before leaving to retain an unsaved diagram. Old browser-local drafts are left untouched and are no longer opened automatically.
Keyboard shortcuts
| Action | Shortcut |
|---|---|
| Save to cloud | Ctrl/Cmd+S. Sign in if prompted. |
| Find a class, member, package, or note | Ctrl/Cmd+K, then Arrow Up/Down and Enter. |
| Copy / Paste selection | Ctrl/Cmd+C / Ctrl/Cmd+V from the canvas. Paste requires an editable diagram. |
| Duplicate selection | Ctrl/Cmd+D from the canvas. |
| Undo / Redo | Ctrl/Cmd+Z / Ctrl/Cmd+Shift+Z or Ctrl/Cmd+Y from the canvas. |
| Delete selection | Delete or Backspace from the canvas. Deleting a class also removes its incident relationships. |
| Choose connector side | Focus a selected connector head and use an arrow key. |
| Cancel or close | Escape cancels a member, connected-class or package form or connector-head preview, closes Find or a menu, or exits Focus connections from the canvas. |
Troubleshoot your diagram
| Symptom | What to try |
|---|---|
| A head stays on an unexpected side | Check whether that end is Fixed. Choose its Auto control to resume automatic placement. |
| A relationship is rejected | Check endpoints, exact duplicates, self inheritance/realization, and inheritance cycles. Give distinct structural links different roles or labels. |
| A member cannot be saved | Supply required names/types, remove duplicate parameter names or member signatures, and review the validation message. Use Text for unsupported custom notation. |
| A form says members changed | Cancel and reopen it after Undo or another text edit to use the current member version. |
| A class or member is out of view | Use Find or Ctrl/Cmd+K. Member results reveal full details and focus the matching inspector section; Fit diagram and the minimap also help. |
| A file cannot be imported | Choose an exported Erd Go class diagram JSON file, not SQL, a Builder file, SVG, or a modeling plan. Your current diagram is retained on error. |
| Cloud saving failed | Keep the diagram open, check your sign-in and connection, then retry. Download JSON before leaving the page to keep an editable backup. |
Plan a class model with AI
Use Copy AI Prompt to share this guide with your assistant, then describe responsibilities, ownership, inheritance, and multiplicities. Ask for clarification where requirements leave a relationship ambiguous.
Request classifier names, member signatures, and a relationship list with explicit From and To roles. Build the result using the visual Library and inspector. The following plan is descriptive, not an import language.
Class Customer
Attribute: - id: UUID
Operation: + placeOrder(items: List<OrderItem>): Order
Class Order
Operation: + calculateTotal(): Decimal
Association: Customer → Order
Label: places
Customer end: 1
Order end: 0..*