react-dialog-mxy
v0.0.25
Published
react learn template
Downloads
2
Maintainers
Readme
react dialog components learn
preview
preview:https://mxyhi.github.io/react-component-learn/
learn react
install
- npm
npm i react-dialog-mxy
- yarn
yarn add react-dialog-mxy
- pnpm
pnpm add react-dialog-mxy
example
import { useState } from 'react';
import { Dialog } from 'react-dialog-mxy';
function App() {
const [isOpen, setIsOpen] = useState(false);
return (
<div>
<button
onClick={() => {
setIsOpen(true);
}}
className="bg-blue-500 rounded shadow px-2 py-1 active:bg-blue-600 text-white"
>
打开
</button>
content
<Dialog isShow={isOpen} setShow={setIsOpen} title={<h2>标题</h2>}>
<div>content</div>
</Dialog>
</div>
);
}
export default App;