You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/docs/src/content/docs/guides/edges/labels.mdx
+58-2Lines changed: 58 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,65 @@ import CodeSnippet from '@components/code-snippet/code-snippet.astro';
9
9
10
10
Labels are visual elements attached to edges that can display text, buttons, or any custom content. They automatically position themselves along the edge path and follow the edge as it moves or changes shape.
11
11
12
-
## Using Labels in Edge Components
12
+
## Using Labels in Default Edges
13
13
14
-
To display a label on an edge, use the `NgDiagramBaseEdgeLabelComponent` in the implementation of your edge component:
14
+
To display a label on a **default edge**, you can add a `label` property to the edge's data.
-`--edge-label-background-color` - Label background color
45
+
-`--edge-label-text-color` - Label text color
46
+
-`--edge-label-border-width` - Label border width
47
+
-`--edge-label-border-color` - Label border color
48
+
-`--edge-label-border-transition` - Transition for border changes
49
+
50
+
The default label also uses these semantic variables that map to the design system:
51
+
52
+
-`--ngd-default-edge-label-color` - Label text color
53
+
-`--ngd-default-edge-label-background-color` - Label background color
54
+
-`--ngd-default-edge-label-border-color` - Label border color
55
+
56
+
The default edge applies different styles to labels based on the edge state (normal, hover, selected). You can customize these styles by modifying the following CSS:
Copy file name to clipboardExpand all lines: packages/ng-diagram/projects/ng-diagram/src/lib/components/edge-label/base-edge-label/base-edge-label.component.ts
0 commit comments