Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/demo/twoButtons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Two Buttons
order: 8
---

Demonstrates two buttons with different tooltips on hover.

```jsx
import TwoButtonsDemo from '../examples/twoButtons';

export default () => <TwoButtonsDemo />;
```
29 changes: 29 additions & 0 deletions docs/examples/twoButtons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { UniqueProvider } from '@rc-component/trigger';
import React from 'react';
import '../../assets/bootstrap.less';
import Tooltip from '../../src';

const TwoButtonsDemo = () => (
<UniqueProvider>
<div style={{ margin: 100 }}>
<Tooltip
placement="top"
trigger={['hover']}
overlay="This is the first tooltip"
motion={{ motionName: 'rc-tooltip-zoom' }}
>
<button type="button">Button 1</button>
</Tooltip>
<Tooltip
placement="top"
trigger={['hover']}
overlay="This is the second tooltip"
motion={{ motionName: 'rc-tooltip-zoom' }}
>
<button type="button">Button 2</button>
</Tooltip>
</div>
</UniqueProvider>
);

export default TwoButtonsDemo;
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"test": "rc-test"
},
"dependencies": {
"@rc-component/trigger": "^3.0.0",
"@rc-component/util": "^1.0.1",
"@rc-component/trigger": "^3.6.0",
"@rc-component/util": "^1.3.0",
"classnames": "^2.3.1"
},
"devDependencies": {
Expand Down
5 changes: 5 additions & 0 deletions src/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ export interface TooltipProps
zIndex?: number;
styles?: TooltipStyles;
classNames?: TooltipClassNames;
/**
* Config Tooltip can reuse of the bg for transition usage.
* This is a experimental API, may be not stable.
*/
unique?: TriggerProps['unique'];
}

export interface TooltipStyles {
Expand Down