diff --git a/packages/vkui/src/components/Image/Image.tsx b/packages/vkui/src/components/Image/Image.tsx index 16ac757225..a69a6f3ef0 100644 --- a/packages/vkui/src/components/Image/Image.tsx +++ b/packages/vkui/src/components/Image/Image.tsx @@ -106,6 +106,7 @@ const getBorderRadiusBySizeInPx = ( export const Image: React.FC & { Badge: typeof ImageBadge; Overlay: typeof ImageBase.Overlay; + FloatElement: typeof ImageBase.FloatElement; } = ({ size = IMAGE_DEFAULT_SIZE, borderRadius = 'm', @@ -173,3 +174,6 @@ Image.Badge.displayName = 'Image.Badge'; Image.Overlay = ImageBase.Overlay; Image.Overlay.displayName = 'Image.Overlay'; + +Image.FloatElement = ImageBase.FloatElement; +Image.FloatElement.displayName = 'Image.FloatElement'; diff --git a/packages/vkui/src/components/Image/Readme.md b/packages/vkui/src/components/Image/Readme.md index a532a70c5b..3ff2576508 100644 --- a/packages/vkui/src/components/Image/Readme.md +++ b/packages/vkui/src/components/Image/Readme.md @@ -79,6 +79,52 @@ const OthersFeatures = () => { ); }; +const WithFloatElements = () => { + const [showContextMenu, setShowContextMenu] = useState(true); + const [contextMenuOpened, setContextMenuOpened] = useState(false); + const [contextMenuVisibility, setContextMenuVisibility] = useState('on-hover'); + + return ( + C позиционированными компонентами}> + + + setShowContextMenu(e.target.checked)} + > + Показать контекстное меню + + + +