Một mục mã nguồn mở trong kho dữ liệu GitHub của TopGit: jquense/react-bootstrap-modal, 88 sao, JavaScript. React port of jschr's better bootstrap modals
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Partly a port of jschr's bootstrap modal. Reimplements the Twitter Bootstrap Modal component in a React friendly way. Based on the original work of the react-bootstrap team.
note: React bootstrap modal is compatible with bootstrap 3.3.4+ if you want to use it with an earlier version of bootstrap 3 you need to override the .modal-backdrop styles to be the most recent one.
Features
Scoped focus
Stackable! (use with constraint)
Animated feedback when trying to close a "static" Modal
Straightforward API, no ModalTrigger or Overlay mixins to deal with
Use
var Modal = require('react-bootstrap-modal')
class ModalExample extends React.Component {
render(){
let closeModal = () => this.setState({ open: false })
let saveAndClose = () => {
api.saveData()
.then(() => this.setState({ open: false }))
}
return (
<div>
<button type='button'>Launch modal</button>
<Modal
show={this.state.open}
onHide={closeModal}
aria-labelledby="ModalHeader"
>
<Modal.Header closeButton>
<Modal.Title id='ModalHeader'>A Title Goes here</Modal.Title>
</Modal.Header>
<Modal.Body>
<p>Some Content here</p>
</Modal.Body>
<Modal.Footer>
// If you don't have anything fancy to do you can use
// the convenient `Dismiss` component, it will
// trigger `onHide` when clicked
<Modal.Dismiss className='btn btn-default'>Cancel</Modal.Dismiss>
// Or you can create your own dismiss buttons
<button className='btn btn-primary' onClick={saveAndClose}>
Save
</button>
</Modal.Footer>
</Modal>
</div>
)
}
}
ReactDOM.render(<ModalExample />, document.body);
Styles
If you are already including Twitter Bootstrap styles (e.g. bootstrap.min.css), then include /lib/css/rbm-patch.css.
If you want to use this module without Twitter Bootstrap, then include /lib/css/rbm-complete.css.
If you do not like the Bootstrap visual look and feel, you can adjust variables.less to suit your needs and transpile it to css yourself.
Components
Modal
The main Modal Component.
Props
show: Boolean(default false) make the Modal visible or hidden
backdrop: Enum<'static', true, false>(default true) - Should the modal render a backdrop overlay. "static" backdrops are not dismissible by clicking the backdrop.
keyboard: Boolean(default true) Modal is dismissible via the esc key
transitionBoolean(default true) Fade the entry and exit of the modal. You can also provide a
Transition component from the react-transition-group v2 library to customize the animation more minutely.
attentionClass: String(default 'shake') - an animation class added to the modal when a "static" backdrop is clicked, set to nothing if
no animation is desired
container: Node(default document.body), a DOM Node to append the modal too
onEnter: handler fires right before the Modal animates in
onEntering: handler fires as the Modal starts entering
onEntered: handler fires after the enter animation finishes
onExit: handler fires right before the Modal animates out
onExiting: handler fires as the Modal starts exiting
onExited: handler fires after the exit animation finishes
Modal.Header
The Header section of Modal. If not included be sure to add an aria-labelledby elsewhere to keep the Modal accessible.
Props
closeButton: Boolean(default true) - render a close button or not
onClose: Function() - a Handle when the close button is clicked. if left undefined the Header will automatically wire itself into the parent Modal onHide(), so you only need to specify a handler if you want a different behavior
Modal.Title
Modal.Body
The main content of the Modal, a convenience Component for: <div className='modal-body'>content</div>
Modal.Footer
The bottom footer of the Modal, a convenience Component for: <div className='modal-footer'>content</div>
Modal.Dismiss
A dismiss button for the Parent Modal. Dismiss button will trigger its parent Modal onHide() handler. You don't need to use a Dismiss button, they are just a Convenience Component.
Modal.BaseModal
BaseModal represents just the modal markup without any of the logic to render it to the document.body. It is generally not recommended that you work with this component directly. You can use it if you really want to render a Modal inline.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/jquense/react-bootstrap-modal là nguồn chính thức.
jquense/react-bootstrap-modal có bao nhiêu sao?
jquense/react-bootstrap-modal có 88 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/jquense/react-bootstrap-modal. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
jquense/react-bootstrap-modal có phải mã nguồn mở không?
TopGit chưa ghi nhận license cho jquense/react-bootstrap-modal. Phần lớn repo public trên GitHub là mã nguồn mở, nhưng điều khoản khác nhau từng repo — mở file LICENSE để xác nhận.
jquense/react-bootstrap-modal còn đang phát triển không?
Commit gần nhất trên jquense/react-bootstrap-modal là 6.8 năm trước (theo timestamp GitHub). Repo có 50 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
jquense/react-bootstrap-modal là gì?
jquense/react-bootstrap-modal (jquense/react-bootstrap-modal) là dự án JavaScript trên GitHub. Theo mô tả gốc: React port of jschr's better bootstrap modals
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về react-bootstrap-modal?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về react-bootstrap-modal.