{"id":20237421,"url":"https://github.com/react-widget/popup","last_synced_at":"2025-06-23T01:40:28.595Z","repository":{"id":32731543,"uuid":"139154168","full_name":"react-widget/popup","owner":"react-widget","description":"https://react-widget.github.io/popup/","archived":false,"fork":false,"pushed_at":"2023-01-04T16:58:00.000Z","size":4912,"stargazers_count":1,"open_issues_count":21,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-14T17:43:27.252Z","etag":null,"topics":["popup","react-widget"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/react-widget.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-29T13:41:35.000Z","updated_at":"2021-08-04T10:50:27.000Z","dependencies_parsed_at":"2023-01-14T22:04:10.232Z","dependency_job_id":null,"html_url":"https://github.com/react-widget/popup","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/react-widget/popup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-widget%2Fpopup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-widget%2Fpopup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-widget%2Fpopup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-widget%2Fpopup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/react-widget","download_url":"https://codeload.github.com/react-widget/popup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-widget%2Fpopup/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261396532,"owners_count":23152451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["popup","react-widget"],"created_at":"2024-11-14T08:26:55.182Z","updated_at":"2025-06-23T01:40:23.582Z","avatar_url":"https://github.com/react-widget.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-widget-popup\n\n## 安装\n\n```\nnpm install --save react-widget-popup\n```\n\n## 使用\n\n[![Edit react-widget-popup](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/mystifying-keller-i2xlv?fontsize=14\u0026hidenavigation=1\u0026theme=dark)\n\n```jsx\nimport Popup from 'react-widget-popup';\nimport 'react-widget-popup/style';\n\nexport default function App(){\n    return (\n        \u003cPopup\n            visible={true}\n            style={{\n                left: 100,\n                top: 100\n            }}\n        \u003e\n            test\n        \u003c/Popup\u003e\n    )\n}\n\n```\n\n### Interfaces\n\n```ts\ntype statusTypes = 'unmounted' | 'exited' | 'entering' | 'entered' | 'exiting' ;\n\ninterface PopupProps extends React.HTMLAttributes\u003cany\u003e {\n\t/** 样式前缀 */\n\tprefixCls?: string;\n\t/** popup元素样式 */\n\tstyle?: React.CSSProperties;\n\t/** popupCSS样式名 */\n\tclassName?: string;\n\t/** popup根节点CSS样式名 */\n\trootClassName?: string;\n\t/** popup根节点样式 */\n\trootStyle?: React.CSSProperties;\n\t/** popup元素属性 */\n\trootProps?: React.HTMLAttributes\u003cany\u003e;\n\t/** 否显示popup(受控) */\n\tvisible?: boolean;\n\t/** 使用fixed定位popup */\n\tfixed?: boolean;\n\t/** 初始不显示的情况下不渲染组件 */\n\tlazy?: boolean;\n\t/** 当destroyOnClose=false时，组件刷新时强制更新 */\n\tforceRender?: boolean;\n\t/** CSSTransition参数，参考：react-transition-group */\n\ttransition?: Partial\u003cCSSTransitionProps\u003e;\n\t/** 隐藏销毁弹组件 */\n\tdestroyOnClose?: boolean;\n\t/** popup显示用于获取元素显示位置信息，大部分情况下建议直接用style */\n\tgetPosition?: (\n\t\tdom: HTMLElement\n\t) =\u003e {\n\t\ttop?: number | string;\n\t\tleft?: number | string;\n\t\tright?: number | string;\n\t\tbottom?: number | string;\n\t};\n\t/** 禁用mask */\n\tdisableMask?: boolean;\n\t/** 是否开启遮罩层 */\n\tmask?: boolean;\n\t/** 遮罩层样式 */\n\tmaskStyle?: React.CSSProperties;\n\t/** 遮罩层组件属性 */\n\tmaskProps?: React.HTMLAttributes\u003cany\u003e;\n\t/** 遮罩层样式名称 */\n\tmaskClassName?: string;\n\t/** CSSTransition参数，参考：react-transition-group */\n\tmaskTransition?: Partial\u003cCSSTransitionProps\u003e;\n\t/** 内部使用 */\n\tcomponent?: React.ElementType;\n\t/** 内部使用 */\n\tmaskComponent?: React.ElementType;\n\t/** 内部使用 */\n\trootComponent?: React.ElementType;\n\t/** 内部使用 */\n\twrapContent?: (node: React.ReactNode) =\u003e React.ReactNode;\n}\n```\n\n### defaultProps\n\n```js\n{\n    prefixCls: \"rw-popup\",\n    style: {},\n    className: \"\",\n    rootClassName: \"\",\n\n    fixed: false,\n    lazy: true,\n    transition: {},\n    destroyOnClose: true,\n\n    disableMask: false,\n    mask: false,\n    maskStyle: {},\n    maskProps: {},\n    maskClassName: \"\",\n    maskTransition: {},\n\n    component: \"div\",\n    maskComponent: \"div\",\n    rootComponent: \"div\"\n}\n```\n\n### 基础样式\n\n```css\n.rw-popup-root {\n    /* TODO */\n}\n\n.rw-popup {\n    position: absolute;\n    left: 0;\n    top: 0;\n    outline: 0;\n}\n\n.rw-popup-mask {\n    position: absolute;\n    left: 0;\n    top: 0;\n    right: 0;\n    bottom: 0;\n    background: #000;\n    opacity: 0.1;\n}\n\n.rw-popup-fixed,\n.rw-popup-mask-fixed {\n    position: fixed;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-widget%2Fpopup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freact-widget%2Fpopup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-widget%2Fpopup/lists"}