Skip to content

Commit

Permalink
Expose position prop in DotTip component (#14972)
Browse files Browse the repository at this point in the history
* Add position prop to DotTip

Added `position` prop to DotTip component. Closes #14923

* Update index.js
  • Loading branch information
HardeepAsrani authored and noisysocks committed Jul 11, 2019
1 parent 4c55270 commit 99a7eb4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/nux/src/components/dot-tip/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ A string that uniquely identifies the tip. Identifiers should be prefixed with t
- Type: `string`
- Required: Yes

### position

The direction in which the popover should open relative to its parent node. Specify y- and x-axis as a space-separated string. Supports `"top"`, `"middle"`, `"bottom"` y axis, and `"left"`, `"center"`, `"right"` x axis.

- Type: `String`
- Required: No
- Default: `"middle right"`

### children

Any React element or elements can be passed as children. They will be rendered within the tip bubble.
3 changes: 2 additions & 1 deletion packages/nux/src/components/dot-tip/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function onClick( event ) {
}

export function DotTip( {
position = 'middle right',
children,
isVisible,
hasNextTip,
Expand All @@ -33,7 +34,7 @@ export function DotTip( {
return (
<Popover
className="nux-dot-tip"
position="middle right"
position={ position }
noArrow
focusOnMount="container"
getAnchorRect={ getAnchorRect }
Expand Down

0 comments on commit 99a7eb4

Please sign in to comment.