0.38.0 • Published 4 months ago
@clds/popover v0.38.0
@clds/popover
Documentation of the Cloudinary Popover component.
The purpose of this component is to display a popover based on rc-tooltip
component (reference).
Installation
Install the package using Yarn:
yarn add @cld/popover
Usage
import React from 'react';
import Button from '@cld/button';
import Popover from '@cld/popover';
const PopoverDemo = () => {
const [visible, setVisible] = useState(false);
return (
<Popover
overlay={<>Hello there!</>}
visible={visible}
onVisibleChange={setVisible}
trigger="click"
placement="bottomRight"
>
<Button>Open Popover</Button>
</Popover>
);
};
Props
Most props come from rc-tooltip component.
Name | Req | Type | Default | |
---|---|---|---|---|
overlayClassName | string | additional className added to popup overlay | ||
trigger | string | string[] | 'hover' | which actions cause tooltip shown. enum of 'hover','click','focus' |
mouseEnterDelay | number | 0 | delay time to show when mouse enter.unit: s. | |
mouseLeaveDelay | number | 0.1 | delay time to hide when mouse leave.unit: s. | |
overlayStyle | Object | additional style of overlay node | ||
prefixCls | String | rc-tooltip | prefix class name | |
transitionName | String | Object | same as https://github.com/react-component/animate | |
onVisibleChange | Function | call when visible is changed | ||
afterVisibleChange | Function | call after visible is changed | ||
visible | boolean | whether tooltip is visible | ||
defaultVisible | boolean | whether tooltip is visible initially | ||
placement | String | one of 'left','right','top','bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight' | ||
align | Object: alignConfig of dom-align | value will be merged into placement's config | ||
onPopupAlign | function(popupDomNode, align) | callback when popup node is aligned | ||
overlay | React.Element | () => React.Element | popup content | |
arrowContent | React.Node | null | arrow content | |
getTooltipContainer | function | Function returning html node which will act as tooltip container. By default the tooltip attaches to the body. If you want to change the container, simply return a new element. | ||
destroyTooltipOnHide | boolean | FALSE | whether destroy tooltip when tooltip is hidden | |
id | String | Id which gets attached to the tooltip content. Can be used with aria-describedby to achieve Screenreader-Support. | ||
paperProps | object | {rounded: boolean, padded: boolean} | Configuration of paper component which wraps popover content. |
Versioning
This library follows Semantic Versioning.
License
See LICENSE
0.38.0
4 months ago
0.37.0
5 months ago
0.33.10
9 months ago
0.33.7
9 months ago
0.36.3
6 months ago
0.33.6
9 months ago
0.36.2
6 months ago
0.35.3
8 months ago
0.33.5
10 months ago
0.36.1
6 months ago
0.35.2
8 months ago
0.36.0
7 months ago
0.35.1
8 months ago
0.33.3
10 months ago
0.32.4
10 months ago
0.35.0
8 months ago
0.33.2
10 months ago
0.34.0
9 months ago
0.33.1
10 months ago
0.33.0
10 months ago
0.33.9
9 months ago
0.33.8
9 months ago
0.32.3
11 months ago
0.32.2
11 months ago
0.32.1
11 months ago
0.32.0
12 months ago
0.31.1
12 months ago
0.30.1
12 months ago
0.30.0
12 months ago
0.29.0
12 months ago
0.28.1
12 months ago
0.28.0
12 months ago
0.27.0
12 months ago