Skip to content

Commit

Permalink
Merge pull request #2097 from FormidableLabs/patch-missing-text-compo…
Browse files Browse the repository at this point in the history
…nent-type

Patch missing text component type
  • Loading branch information
Becca Bailey authored Feb 14, 2022
2 parents 5d96196 + c77206b commit dddbaa6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/src/content/docs/victory-label.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,14 @@ _examples:_ `text={(datum) => "x: " + datum.x}`, `text="Apples\n(green)"`, `text
/>
```

## textComponent

`type: element`

The `textComponent` prop takes a component instance which will be used to create text elements when `VictoryLabel` renders labels.

_default:_ `<Text />`

## textAnchor

`type: "start" || "middle" || "end" || "inherit" || function`
Expand Down
1 change: 1 addition & 0 deletions packages/victory-core/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ export interface VictoryLabelProps {
style?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
tabIndex?: NumberOrCallback;
text?: string[] | StringOrNumberOrCallback;
textComponent?: React.ReactElement;
textAnchor?: TextAnchorType | { (): TextAnchorType };
title?: string;
transform?: string | {} | { (): string | {} };
Expand Down

0 comments on commit dddbaa6

Please sign in to comment.