0.38.0 • Published 4 months ago

@clds/popover v0.38.0

Weekly downloads
-
License
-
Repository
github
Last release
4 months ago

@clds/popover


npm version

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.

NameReqTypeDefault
overlayClassNamestringadditional className added to popup overlay
triggerstringstring[]'hover'which actions cause tooltip shown. enum of 'hover','click','focus'
mouseEnterDelaynumber0delay time to show when mouse enter.unit: s.
mouseLeaveDelaynumber0.1delay time to hide when mouse leave.unit: s.
overlayStyleObjectadditional style of overlay node
prefixClsStringrc-tooltipprefix class name
transitionNameStringObjectsame as https://github.com/react-component/animate
onVisibleChangeFunctioncall when visible is changed
afterVisibleChangeFunctioncall after visible is changed
visiblebooleanwhether tooltip is visible
defaultVisiblebooleanwhether tooltip is visible initially
placementStringone of 'left','right','top','bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'
alignObject: alignConfig of dom-alignvalue will be merged into placement's config
onPopupAlignfunction(popupDomNode, align)callback when popup node is aligned
overlayReact.Element() => React.Elementpopup content
arrowContentReact.Nodenullarrow content
getTooltipContainerfunctionFunction 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.
destroyTooltipOnHidebooleanFALSEwhether destroy tooltip when tooltip is hidden
idStringId which gets attached to the tooltip content. Can be used with aria-describedby to achieve Screenreader-Support.
paperPropsobject{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