Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[@mantine/core] Tooltip: Add nested tooltips support (#2768)
- Loading branch information
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/mantine-demos/src/demos/core/Tooltip/Tooltip.demo.nested.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import React from 'react'; | ||
import { MantineDemo } from '@mantine/ds'; | ||
import { Tooltip, Button, Group } from '@mantine/core'; | ||
|
||
const code = ` | ||
import { Tooltip, Button } from '@mantine/core'; | ||
function Demo() { | ||
return ( | ||
<Tooltip | ||
label="top" | ||
position="top" | ||
closeDelay={1500} | ||
> | ||
<Tooltip | ||
label="bottom" | ||
position="bottom" | ||
openDelay={500} | ||
closeDelay={1000} | ||
> | ||
<Tooltip | ||
label="left" | ||
position="left" | ||
openDelay={1000} | ||
closeDelay={500} | ||
> | ||
<Tooltip | ||
label="right" | ||
position="right" | ||
openDelay={1500} | ||
> | ||
<Button variant="outline">Nested Tooltips</Button> | ||
</Tooltip> | ||
</Tooltip> | ||
</Tooltip> | ||
</Tooltip> | ||
); | ||
} | ||
`; | ||
|
||
function Demo() { | ||
return ( | ||
<Group position="center"> | ||
<Tooltip label="top" position="top" closeDelay={1500}> | ||
<Tooltip label="bottom" position="bottom" openDelay={500} closeDelay={1000}> | ||
<Tooltip label="left" position="left" openDelay={1000} closeDelay={500}> | ||
<Tooltip label="right" position="right" openDelay={1500}> | ||
<Button variant="outline">Nested Tooltips</Button> | ||
</Tooltip> | ||
</Tooltip> | ||
</Tooltip> | ||
</Tooltip> | ||
</Group> | ||
); | ||
} | ||
|
||
export const nested: MantineDemo = { | ||
type: 'demo', | ||
component: Demo, | ||
code, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters