Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo-abc committed Feb 22, 2021
1 parent 8fe994f commit 391adc2
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,25 @@ Import the `focusOn` function from the package and use it as an action on your m

```html
<script>
import { focusOn } from 'svelte-focus-on';
import { useFocusOn } from 'svelte-focus-on';
const focusOn = useFocusOn();
</script>

<div class="modal" use:focusOn>
<!-- ... -->
</div>
```


## Why

I mostly made this package because I found myself using a similar action in different sites. You can most likely do your own action using similar packages.

## Dependencies

Most of the work of this packages is leveraged from:

- *[dom-focus-lock](https://github.com/theKashey/dom-focus-lock)*: Focus trap.
- *[aria-hidden](https://github.com/theKashey/aria-hidden)*: Hides everything from accessibility tools except the specified element.
- *[body-scroll-lock](https://github.com/willmcpo/body-scroll-lock)*: Disables scrolling for the body.

0 comments on commit 391adc2

Please sign in to comment.