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 |
footer | boolean |
className | string |
wrapClassName | string |
width | number |
height | number |
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"
width={400}
height={200}
maskable
onCancel={() => {
setVisible(false);
}}
>
hello world!
</NiceModal>
</div>
);
}
Button
props | type |
---|---|
type |
primary success warning danger link default
|
size |
middle small large
|
disabled | boolean |
ripple | boolean |
circle | boolean |
onClick | () => void |
children | string |
icon |
icon-search icon-unfold icon-up_arrow icon-right_arrow icon-down_arrow icon-left-arrow icon-delete ....
|
import { NiceButton } from "nights-ui";
function Index() {
const handleClick = () => {
alert("click me");
};
return (
<NiceButton
type="primary"
size="middle"
icon="icon-search"
onClick={handleClick}
>
alert
</NiceButton>
);
}