Usecase Diagram Config Schema
https://mermaid.js.org/schemas/config.schema.json#/$defs/UsecaseDiagramConfigThe object containing configurations specific for usecase diagrams.
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|---|---|---|---|---|---|---|---|
| Can be instantiated | No | Unknown status | No | Forbidden | Allowed | none | config.schema.json* |
UsecaseDiagramConfig Type
object (Usecase Diagram Config)
all of
UsecaseDiagramConfig Properties
| Property | Type | Required | Nullable | Defined by |
|---|---|---|---|---|
| theme | string | Optional | cannot be null | Mermaid Config |
| look | string | Optional | cannot be null | Mermaid Config |
| wrappingWidth | number | Required | cannot be null | Mermaid Config |
| minNodeWidth | number | Required | cannot be null | Mermaid Config |
| actorFontSize | number | Optional | cannot be null | Mermaid Config |
| actorFontFamily | string | Optional | cannot be null | Mermaid Config |
| actorFontWeight | string | Optional | cannot be null | Mermaid Config |
| usecaseFontSize | number | Optional | cannot be null | Mermaid Config |
| usecaseFontFamily | string | Optional | cannot be null | Mermaid Config |
| usecaseFontWeight | string | Optional | cannot be null | Mermaid Config |
| nodeSpacing | number | Optional | cannot be null | Mermaid Config |
| rankSpacing | number | Optional | cannot be null | Mermaid Config |
| diagramPadding | number | Optional | cannot be null | Mermaid Config |
| colorScheme | string | Optional | cannot be null | Mermaid Config |
theme
Theme, the CSS style sheet. You may also use themeCSS to override this value.
theme
is optional
Type:
stringcannot be null
defined in: Mermaid Config
theme Type
string
theme Constraints
enum: the value of this property must be equal to one of the following values:
| Value | Explanation |
|---|---|
"default" | |
"base" | |
"dark" | |
"forest" | |
"neutral" | |
"neo" | |
"neo-dark" | |
"redux" | |
"redux-dark" | |
"redux-color" | |
"redux-dark-color" | |
"null" | Can be set to disable any pre-defined mermaid theme |
theme Default Value
The default value is:
"redux-color"look
Defines which main look to use for the diagram.
look
is optional
Type:
stringcannot be null
defined in: Mermaid Config
look Type
string
look Constraints
enum: the value of this property must be equal to one of the following values:
| Value | Explanation |
|---|---|
"classic" | |
"handDrawn" | |
"neo" |
look Default Value
The default value is:
"neo"wrappingWidth
Width of nodes where text is wrapped.
When using markdown strings the text is wrapped automatically, this value sets the max width of a text before it continues on a new line.
wrappingWidth
is required
Type:
numbercannot be null
defined in: Mermaid Config
wrappingWidth Type
number
wrappingWidth Default Value
The default value is:
120minNodeWidth
Minimum width of the label area of a node.
Labels narrower than this are widened to it, so nodes with short text get a uniform width; the node's own padding is added on top, the same way it is for wrappingWidth. Nodes with an explicit width are not affected.
minNodeWidth
is required
Type:
numbercannot be null
defined in: Mermaid Config
minNodeWidth Type
number
minNodeWidth Default Value
The default value is:
120actorFontSize
Font size for actor labels
actorFontSize
is optional
Type:
numbercannot be null
defined in: Mermaid Config
actorFontSize Type
number
actorFontSize Constraints
minimum: the value of this number must greater than or equal to: 1
actorFontSize Default Value
The default value is:
14actorFontFamily
Font family for actor labels.
Written verbatim into an inline CSS custom property, so the characters that could terminate a declaration or open a new one are excluded: ;, <, >, (, ), {, }, and \. Quotes, commas, and spaces stay allowed for font stacks such as "Open Sans", sans-serif.
actorFontFamily
is optional
Type:
stringcannot be null
defined in: Mermaid Config
actorFontFamily Type
string
actorFontFamily Constraints
pattern: the string must match the following regular expression:
/^[^;<>(){}\\]*$/actorFontFamily Default Value
The default value is:
"\"Open Sans\", sans-serif"actorFontWeight
Font weight for actor labels.
Restricted to the CSS font-weight keywords and numeric weights, since this value is written verbatim into an inline CSS custom property.
actorFontWeight
is optional
Type:
stringcannot be null
defined in: Mermaid Config
actorFontWeight Type
string
actorFontWeight Constraints
pattern: the string must match the following regular expression:
/^(normal|bold|bolder|lighter|inherit|initial|revert|unset|[1-9][0-9]{0,3})$/actorFontWeight Default Value
The default value is:
"normal"usecaseFontSize
Font size for usecase labels
usecaseFontSize
is optional
Type:
numbercannot be null
defined in: Mermaid Config
usecaseFontSize Type
number
usecaseFontSize Constraints
minimum: the value of this number must greater than or equal to: 1
usecaseFontSize Default Value
The default value is:
12usecaseFontFamily
Font family for usecase labels.
Constrained the same way as actorFontFamily.
usecaseFontFamily
is optional
Type:
stringcannot be null
defined in: Mermaid Config
usecaseFontFamily Type
string
usecaseFontFamily Constraints
pattern: the string must match the following regular expression:
/^[^;<>(){}\\]*$/usecaseFontFamily Default Value
The default value is:
"\"Open Sans\", sans-serif"usecaseFontWeight
Font weight for usecase labels.
Constrained the same way as actorFontWeight.
usecaseFontWeight
is optional
Type:
stringcannot be null
defined in: Mermaid Config
usecaseFontWeight Type
string
usecaseFontWeight Constraints
pattern: the string must match the following regular expression:
/^(normal|bold|bolder|lighter|inherit|initial|revert|unset|[1-9][0-9]{0,3})$/usecaseFontWeight Default Value
The default value is:
"normal"nodeSpacing
Spacing between nodes on the same level
nodeSpacing
is optional
Type:
numbercannot be null
defined in: Mermaid Config
nodeSpacing Type
number
nodeSpacing Constraints
minimum: the value of this number must greater than or equal to: 0
nodeSpacing Default Value
The default value is:
50rankSpacing
Spacing between nodes on different levels
rankSpacing
is optional
Type:
numbercannot be null
defined in: Mermaid Config
rankSpacing Type
number
rankSpacing Constraints
minimum: the value of this number must greater than or equal to: 0
rankSpacing Default Value
The default value is:
50diagramPadding
Padding around the entire diagram
diagramPadding
is optional
Type:
numbercannot be null
defined in: Mermaid Config
diagramPadding Type
number
diagramPadding Constraints
minimum: the value of this number must greater than or equal to: 0
diagramPadding Default Value
The default value is:
20colorScheme
How a use case diagram takes its colours from the active theme.
role (the default) gives every element of a kind one colour, read from the usecaseActorBkg / usecaseActorBorder, usecaseBkg / usecaseBorder, and usecaseBoundaryBkg / usecaseBoundaryBorder theme variables. Colour then says what an element is, and it is invariant under insertion, reordering, and renaming -- adding one use case in the middle does not recolour the ones after it, so diffs, documentation screenshots, and visual baselines stay stable.
rotate instead gives each actor, use case, and system boundary its own slot from the theme's categorical palette (borderColorArray / bkgColorArray), the way ER entities and class boxes are coloured. Actors and use cases share one cycle, and system boundaries run a second one from zero, so a boundary is never forced to match an element inside it. Within the shared cycle the actors are numbered first and the use cases after them, each in declaration order -- an interleaved actor A, usecase U, actor B is therefore numbered A, B, U rather than A, U, B. This buys per-instance variety at the cost of the stability role has: inserting an element shifts the colour of every later element of its own kind, and inserting an actor shifts the use cases too. Only the colour themes (redux-color, redux-dark-color) carry a palette, so on every other theme the two settings render identically.
classDef and style keep overriding both, whichever is set.
colorScheme
is optional
Type:
stringcannot be null
defined in: Mermaid Config
colorScheme Type
string
colorScheme Constraints
enum: the value of this property must be equal to one of the following values:
| Value | Explanation |
|---|---|
"role" | |
"rotate" |
colorScheme Default Value
The default value is:
"role"