Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

React Dialog

License

NotificationsYou must be signed in to change notification settings

react-component/dialog

Repository files navigation

react dialog component

NPM versiondumibuild statusTest coveragenpm downloadbundle size

Screenshot

Example

http://localhost:8007/examples/

online example:https://dialog.react-component.vercel.app/

Install

rc-dialog

Usage

varDialog=require('rc-dialog');ReactDOM.render(<Dialogtitle={title}onClose={callback1}visible><p>first dialog</p></Dialog>),document.getElementById('t1'));// use dialog

API

rc-dialog

NameTypeDefaultDescriptionVersion
prefixClsStringrc-dialogThe dialog dom node's prefixCls
classNameStringadditional className for dialog
classNames{ header?: string; body?: string; footer?: string; mask?: string; content?: string; wrapper?: string; }pass className to target area
styles{ header?: CSSProperties; body?: CSSProperties; footer?: CSSProperties; mask?: CSSProperties; content?: CSSProperties; wrapper?: CSSProperties; }pass styles to target area
styleObject{}Root style for dialog element.Such as width, height
zIndexNumber
visibleBooleanfalsecurrent dialog's visible status
animationStringpart of dialog animation css class name
maskAnimationStringpart of dialog's mask animation css class name
transitionNameStringdialog animation css class name
maskTransitionNameStringmask animation css class name
titleString|React.ElementTitle of the dialog
footerReact.Elementfooter of the dialog
closableBoolean | ({ closeIcon?: React.ReactNode; disabled?: boolean, afterClose:function } & React.AriaAttributes)truewhether show close button
maskBooleantruewhether show mask
maskClosableBooleantruewhether click mask to close
keyboardBooleantruewhether support press esc to close
mousePosition{x:number,y:number}set pageX and pageY of current mouse(it will cause transform origin to be set).
onClosefunction()called when click close button or mask
afterClosefunction()called when close animation end
getContainerfunction(): HTMLElementto determine where Dialog will be mounted
destroyOnHiddenBooleanfalseto unmount child compenents on onClose
closeIconReactNodespecific the close icon.
forceRenderBooleanfalseCreate dialog dom node before dialog first show
focusTriggerAfterCloseBooleantruefocus trigger element when dialog closed
modalRender(node: ReactNode) => ReactNodeCustom modal content render8.3.0

Development

npm installnpm start

Test Case

npm testnpm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

rc-dialog is released under the MIT license.

🤝 Contributing

Contribution Leaderboard

[8]ページ先頭

©2009-2025 Movatter.jp