Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hengshanmwc/svelte-popup
svelte-popup
https://github.com/hengshanmwc/svelte-popup
Last synced: 3 months ago
JSON representation
svelte-popup
- Host: GitHub
- URL: https://github.com/hengshanmwc/svelte-popup
- Owner: hengshanMWC
- Created: 2022-02-03T12:08:55.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-16T06:29:49.000Z (almost 3 years ago)
- Last Synced: 2024-03-25T00:42:11.373Z (9 months ago)
- Language: Svelte
- Size: 197 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# introduce
Popup components,Support pop-up from top to bottom, left and right
[demo page](https://hengshanmwc.github.io/svelte-popup/dist/index.html)
# install
```
npm i svelte-popup
// or
yarn add svelte-popup
// or
pnpm i svelte-popup
```# Basic use
```js
import { Popup } from "svelte-popup"; // 4kb
let show = true
function toggle() {
show = !show;
}center:{show ? "hide" : "show"}
popup
```
# Prop
| name | explain | type | default |
| -------- | ----------------------------: | :--------------------------------------: | :-----: |
| show | show or not | boolean | - |
| position | eject direction | center \| top \| right \| bottom \| left | center |
| duration | transition attribute duration | number | 300 |
| delay | transition attribute delay | number | 0 |# slot
| name | explain |
| ---- | ------: |
| - | content |