Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hengshanmwc/svelte-popup

svelte-popup
https://github.com/hengshanmwc/svelte-popup

Last synced: 3 months ago
JSON representation

svelte-popup

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 |