sk-interface
v4.0.10
Published
## 安装
Downloads
19
Readme
sk-interface
安装
yarn add sk-interface
or
npm install sk-interface
使用
完全受控于外部组件
import React from 'react'
import { SwapPanel, useDisclosure } from 'sk-interface'
function App() {
return (
<div className="App">
<div style={{
position: 'fixed',
top: '50px',
right: '50px',
width: '375px',
borderRadius: '8px',
overflow: 'hidden',
}} >
<SwapPanel />
</div>
</div>
)
}
export default App
以挂件形式自控
import React from 'react'
import { SwapTroggle, useDisclosure } from 'sk-interface'
function App() {
const { isOpen, onOpen, onClose } = useDisclosure()
return (
<div className="App">
<SwapTroggle isOpen={isOpen} onClose={onClose} />
<button onClick={onOpen}>
打开Swap面板
</button>
</div>
)
}
export default App