一键导入
groww-modal-popup
Modal dialog component with animations and overlay. Use when building dialogs, confirmations, or focused interactions that require user attention.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Modal dialog component with animations and overlay. Use when building dialogs, confirmations, or focused interactions that require user attention.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Accordion component with collapsible sections. Use for FAQs, nested content, or expandable details sections.
Button component with variants, sizes, loading states, and icon support. Use when creating clickable actions, forms, or navigation buttons.
Calendar component for date and month selection. Use when building date pickers, scheduling interfaces, or date range selectors.
Carousel component for image/content sliders with navigation controls. Use for image galleries, hero sections, or content that scrolls horizontally.
Checkbox component for boolean or multi-select inputs. Use when building forms with boolean toggles or multiple selection lists.
Dropdown menu component with trigger and content pattern. Use when building selectable menus, action menus, or nested navigation.
| name | groww-modal-popup |
| description | Modal dialog component with animations and overlay. Use when building dialogs, confirmations, or focused interactions that require user attention. |
import Popup from '@groww-tech/ui-toolkit/dist/esm/components/atoms/Popup';
// or
import { Popup } from '@groww-tech/ui-toolkit';
interface PopupProps {
visible: boolean; // Show/hide modal (required)
onClose: () => void; // Close handler (required)
width?: number | string; // Modal width
height?: number | string; // Modal height
animation?: 'fade' | 'zoom' | 'slideUp' | 'slideDown' | 'slideLeft' | 'slideRight' | 'rotate' | 'door';
closeMaskOnClick?: boolean; // Close when clicking overlay
closeOnEsc?: boolean; // Close on Escape key
showCloseButton?: boolean; // Show close X button
customStyles?: React.CSSProperties; // Custom styles
className?: string;
dataTestId?: string;
}
const [isOpen, setIsOpen] = useState(false);
<Popup
visible={isOpen}
onClose={() => setIsOpen(false)}
>
<h2>Confirm Action</h2>
<p>Are you sure you want to proceed?</p>
<button onClick={handleConfirm}>Confirm</button>
<button onClick={() => setIsOpen(false)}>Cancel</button>
</Popup>
<Popup
visible={isOpen}
onClose={handleClose}
width={600}
height="auto"
>
<ConfirmationDialog />
</Popup>
// Slide up from bottom
<Popup
visible={isOpen}
onClose={handleClose}
animation="slideUp"
>
<BottomSheetContent />
</Popup>
// Zoom effect
<Popup
visible={isOpen}
onClose={handleClose}
animation="zoom"
>
<CenteredContent />
</Popup>
<Popup
visible={isOpen}
onClose={handleClose}
closeMaskOnClick={true}
closeOnEsc={true}
>
<ModalContent />
</Popup>
<Popup
visible={isOpen}
onClose={handleClose}
width="100vw"
height="100vh"
>
<FullScreenContent />
</Popup>
<Popup
visible={isOpen}
onClose={handleClose}
showCloseButton={true}
width={400}
>
<div className="dialog-content">
<Icon type="warning" size="large" />
<h3>Delete Item?</h3>
<p>This action cannot be undone.</p>
<div className="actions">
<Button variant="secondary" buttonText="Cancel" onClick={handleClose} />
<Button variant="negative" buttonText="Delete" onClick={handleDelete} />
</div>
</div>
</Popup>
<Popup
visible={isOpen}
onClose={handleClose}
width={500}
>
<h2>Edit Profile</h2>
<form onSubmit={handleSubmit}>
<TextInput label="Name" value={name} onChange={setName} />
<TextInput label="Email" value={email} onChange={setEmail} />
<Button buttonText="Save" type="submit" />
</form>
</Popup>