0.1.23 • Published 2 years ago
@minmoo/async-layers v0.1.23
Basic Example
import { AsyncLayersProvider, useLayers } from '@minmoo/async-layers'
export default function App() {
return (
<AsyncLayersProvider>
<Example />
</AsyncLayersProvider>
)
}
function Example() {
const { show } = useLayers(Content)
return (
<div>
<h2>Example</h2>
<button onClick={() => show()}>show</button>
</div>
)
}
function Content() {
return <h2>Content</h2>
}
Options
default options
<AsyncLayersProvider
options={{
position: 'bottom', // component position: 'top', 'bottom', 'left', 'right', 'center'
dimmed: true, // dimmed background
transitionDelay: 350, // component animation time(ms)
draggable: false, //only position bottom has draggable option
dragOptions: {
minHeight: 300, // size when the component is first shown
minY: 80, // maximum draggable position
},
scrollLockElement: null, // background scroll lock element. (default: body)
}}
>
{children}
</AsyncLayersProvider>
useLayers(component, options)
0.1.22
2 years ago
0.1.23
2 years ago
0.1.20
2 years ago
0.1.21
2 years ago
0.1.19
2 years ago
0.1.18
2 years ago
0.1.17
2 years ago
0.1.16
2 years ago
0.1.15
2 years ago
0.1.14
2 years ago
0.1.13
2 years ago
0.1.12
2 years ago
0.1.11
2 years ago
0.1.10
2 years ago
0.1.9
2 years ago
0.1.8
2 years ago
0.1.7
2 years ago
0.1.6
2 years ago
0.1.5
2 years ago
0.1.4
2 years ago
0.1.3
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago
0.1.0
2 years ago