Merge pull request #5109 from dimaMachina/background-props-tsdoc

fix: improve TSDoc comments for `BackgroundProps`
This commit is contained in:
Moritz Klack
2025-03-25 08:47:40 +01:00
committed by GitHub
2 changed files with 25 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@xyflow/react": patch
---
fix: improve TSDoc comments for `BackgroundProps`
@@ -16,6 +16,7 @@ export enum BackgroundVariant {
* @expand * @expand
*/ */
export type BackgroundProps = { export type BackgroundProps = {
/** When multiple backgrounds are present on the page, each one should have a unique id. */
id?: string; id?: string;
/** Color of the pattern */ /** Color of the pattern */
color?: string; color?: string;
@@ -25,16 +26,31 @@ export type BackgroundProps = {
className?: string; className?: string;
/** Class applied to the pattern */ /** Class applied to the pattern */
patternClassName?: string; patternClassName?: string;
/** Gap between repetitions of the pattern */ /**
* The gap between patterns. Passing in a tuple allows you to control the x and y gap
* independently.
* @default '28'
*/
gap?: number | [number, number]; gap?: number | [number, number];
/** Size of a single pattern element */ /**
* The radius of each dot or the size of each rectangle if `BackgroundVariant.Dots` or
* `BackgroundVariant.Cross` is used. This defaults to 1 or 6 respectively, or ignored if
* `BackgroundVariant.Lines` is used.
*/
size?: number; size?: number;
/** Offset of the pattern */ /**
* Offset of the pattern
* @default 2
*/
offset?: number | [number, number]; offset?: number | [number, number];
/** Line width of the Line pattern */ /**
* The stroke thickness used when drawing the pattern.
* @default 1
*/
lineWidth?: number; lineWidth?: number;
/** /**
* Variant of the pattern * Variant of the pattern
* @default BackgroundVariant.Dots
* @example BackgroundVariant.Lines, BackgroundVariant.Dots, BackgroundVariant.Cross * @example BackgroundVariant.Lines, BackgroundVariant.Dots, BackgroundVariant.Cross
* 'lines', 'dots', 'cross' * 'lines', 'dots', 'cross'
*/ */