2.0.3 • Published 6 days ago
nights-ui v2.0.3
Nights UI
一个好用的 UI 框架。Nice UI
Modal
props | type |
---|---|
visible | boolean |
title | string |
okText | string |
cancelText | string |
onOk | () => void |
onCancel | () => void |
children | string || JSX |
maskable | boolean |
import { NiceModal } from "nights-ui";
function Index() {
const [visible, setVisible] = useState(false);
return (
<div>
<button
onClick={() => {
setVisible(true);
}}
>
open
</button>
<NiceModal
visible={visible}
title="nice modal1"
maskable
onCancel={() => {
setVisible(false);
}}
>
hello world!
</NiceModal>
</div>
);
}