-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs(web-react): Add demo with Tooltip on Icon cmp
- New demo with tooltip on Icon component
- Loading branch information
1 parent
f116536
commit 84b227d
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
packages/web-react/src/components/TooltipModern/demo/TooltipIcon.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,35 @@ | ||
import React, { useState } from 'react'; | ||
import { Icon } from '../../Icon'; | ||
import { TooltipModern, TooltipPopover, TooltipTrigger } from '../../Tooltip'; | ||
|
||
const TooltipIcon = () => { | ||
const [openIcon, setOpenIcon] = useState(false); | ||
|
||
return ( | ||
<div className="spirit-feature-tooltip-enable-data-placement"> | ||
<p> | ||
Click on the icon on the right to view the tooltip{' '} | ||
<TooltipModern | ||
id="tooltip-example-with-icon" | ||
isOpen={openIcon} | ||
onToggle={setOpenIcon} | ||
placement="right" | ||
flipFallbackPlacements={['top-start', 'bottom-start', 'left']} | ||
UNSAFE_className="d-inline-block" | ||
isDismissible | ||
> | ||
<TooltipTrigger | ||
elementType={Icon} | ||
name="info" | ||
boxSize={16} | ||
UNSAFE_className="d-inline-block" | ||
marginBottom="space-200" | ||
/> | ||
<TooltipPopover>Close me</TooltipPopover> | ||
</TooltipModern> | ||
</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default TooltipIcon; |
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