UseMedia

A hook to track the size of the screen using the standard Tailwind CSS breakpoints.

- Resize the window to see the breakpoint change.

Installation

jsrepo add hooks/use-media.svelte

Usage

Custom Breakpoints

You can also define your own breakpoints and get full type safety.

- Resize the window to see the breakpoint change at 500px.