Skip to content

Commit 3563bd6

Browse files
committed
chore: pass props to trigger
1 parent 2fd74a6 commit 3563bd6

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

docs/demo/twoButtons.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: Two Buttons
3+
order: 8
4+
---
5+
6+
Demonstrates two buttons with different tooltips on hover.
7+
8+
```jsx
9+
import TwoButtonsDemo from '../examples/twoButtons';
10+
11+
export default () => <TwoButtonsDemo />;
12+
```

docs/examples/twoButtons.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { UniqueProvider } from '@rc-component/trigger';
2+
import React from 'react';
3+
import '../../assets/bootstrap.less';
4+
import Tooltip from '../../src';
5+
6+
const TwoButtonsDemo = () => (
7+
<UniqueProvider>
8+
<div style={{ margin: 100 }}>
9+
<Tooltip
10+
placement="top"
11+
trigger={['hover']}
12+
overlay="This is the first tooltip"
13+
motion={{ motionName: 'rc-tooltip-zoom' }}
14+
>
15+
<button type="button">Button 1</button>
16+
</Tooltip>
17+
<Tooltip
18+
placement="top"
19+
trigger={['hover']}
20+
overlay="This is the second tooltip"
21+
motion={{ motionName: 'rc-tooltip-zoom' }}
22+
>
23+
<button type="button">Button 2</button>
24+
</Tooltip>
25+
</div>
26+
</UniqueProvider>
27+
);
28+
29+
export default TwoButtonsDemo;

src/Tooltip.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ export interface TooltipProps
4545
zIndex?: number;
4646
styles?: TooltipStyles;
4747
classNames?: TooltipClassNames;
48+
/**
49+
* Config Tooltip can reuse of the bg for transition usage.
50+
* This is a experimental API, may be not stable.
51+
*/
52+
unique?: TriggerProps['unique'];
4853
}
4954

5055
export interface TooltipStyles {

0 commit comments

Comments
 (0)