Skip to content

Commit 4bb099d

Browse files
authored
Merge pull request #4 from wysher/fix/readme
Fix/readme
2 parents d25e7d4 + b92b042 commit 4bb099d

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
55
> Great for creating dropdowns, tooltips and popovers
66
7-
Svelte overlay is wrapper copmponent which makes all difficult stuff for you, but you decide when to open/close
8-
it and how it looks.
7+
Svelte overlay is wrapper copmponent which makes all difficult stuff for you, but you decide when to open/close it and how it looks.
98

109
## Features
11-
- it's portaled (always visible, even if inside e.g modal with overflow: hidden)
1210
- may be nested
1311
- if content has not enough space on one side it will try to render on other side. For instance if position is set to `top-left` and there's no room on top position will be set to `bottom-left`. This feature listens to window resize event
1412
- may be open/closed on every trigger and content event or from outside
@@ -66,18 +64,18 @@ To get it work component requires two slots:
6664

6765
**Overlay props**
6866

69-
| Prop name | Type | Description | Default |
67+
| Prop name | Type | Default | Description |
7068
| --- | --- | --- | --- |
71-
| isOpen | Boolean | isOpen state | false |
72-
| position | String | `top-left`<br />`top-center`<br />`top-right`<br />`bottom-left`<br />`bottom-center`<br />`bottom-right`<br />`left-top`<br />`left-center`<br />`left-bottom`<br />`right-top`<br />`right-center`<br />`right-bottom`<br /><br />Uses default position when wrong position was passed | `bottom-right` |
73-
| zIndex | Number | value of z-index for overlay and portaled content | 1 |
74-
| class | string | global class name | '' |
75-
| style | string | style string which will be added at the end of component style attribute | '' |
76-
| closeOnClickOutside | Boolean | if true click outside will close overlay | false |
77-
| closeOnScroll | Boolean | if true scrolling outside content will close overlay | false |
78-
| updateOnScroll | Boolean | if true scrolling will update content position | false |
79-
| onWindowKeyDown | Function | triggers when overlay is opened and user hit any button.<br/>Gets Event as first argument and object of { open, close, toggle, isOpen } | |
80-
| on:toggle | Function | Event dispatched on overlay toggle.<br/>Gets Event as first argument and object of { open, close, toggle, isOpen } | |
69+
| isOpen | Boolean | false | isOpen state |
70+
| position | String | `bottom-right` | `top-left`<br />`top-center`<br />`top-right`<br />`bottom-left`<br />`bottom-center`<br />`bottom-right`<br />`left-top`<br />`left-center`<br />`left-bottom`<br />`right-top`<br />`right-center`<br />`right-bottom`<br /><br />Uses default position when wrong position was passed.<br/> You may import array of all positions with:<br /> ``` import { positions } from 'svelte-overlay'; ``` |
71+
| zIndex | Number | 1 | value of z-index for overlay and content |
72+
| class | string | "" | global class name |
73+
| style | string | "" | style string which will be added at the end of component style attribute |
74+
| closeOnClickOutside | Boolean | false | if true - click outside will close overlay |
75+
| closeOnScroll | Boolean | false | if true - scrolling outside content will close overlay |
76+
| updateOnScroll | Boolean | false | if true - scrolling will update content position |
77+
| onWindowKeyDown | Function | undefined | triggers when overlay is opened and user hit any button.<br/>Gets Event as first argument and object of { open, close, toggle, isOpen } |
78+
| on:toggle | Function | undefined | Event dispatched on overlay toggle.<br/>Gets Event as first argument and object of { open, close, toggle, isOpen } |
8179

8280
**slot props**
8381

@@ -145,6 +143,7 @@ Each slot gets theese props, available through let:propName
145143
</Overlay>
146144
```
147145

146+
---
148147
### Open/close on mouseenter/mouseleave [REPL](https://svelte.dev/repl/d04cf212c9a8406aad8932ca039634ac?version=3.22.2)
149148

150149
```javascript
@@ -164,6 +163,7 @@ Each slot gets theese props, available through let:propName
164163
</Overlay>
165164
```
166165

166+
---
167167
### Open from outside [REPL](https://svelte.dev/repl/f96379b640d74556bf415ae8d74b2598?version=3.22.2)
168168

169169
```javascript
@@ -190,8 +190,9 @@ Each slot gets theese props, available through let:propName
190190
</Overlay>
191191
```
192192

193+
---
193194
### With backdrop, disabled scroll and animations [REPL](https://svelte.dev/repl/cf3db92312394dd1a6efaf3374118b2c?version=3.22.2)
194-
****
195+
195196
```javascript
196197
<script>
197198
import Overlay from 'svelte-overlay';
@@ -249,6 +250,7 @@ Each slot gets theese props, available through let:propName
249250

250251
```
251252

253+
---
252254
### Nested with click outside and close on esc key [REPL](https://svelte.dev/repl/284b4a09eddc4b64b5bd6734712d30ee?version=3.22.2)
253255

254256
```javascript

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svelte-overlay",
3-
"version": "1.4.0",
3+
"version": "1.4.1",
44
"description": "Svelte Overlay component. Great for creating dropdowns, tooltips and popovers",
55
"author": "Mariusz Wachowski",
66
"keywords": [

0 commit comments

Comments
 (0)