Skip to content

Conversation

ieedan
Copy link
Contributor

@ieedan ieedan commented Jun 26, 2025

This PR introduces a useBreakpoints utility that allows you to react to changes in the viewport based on the default tailwind breakpoints or even your own custom breakpoints.

This is useful in instances where you need to know the size of the viewport in your JS code.

You create a custom breakpoint by passing a name (the key) and a string unit for the minimum width.

<script lang="ts">
	import { useBreakpoints } from "runed";
	const breakpoints = useBreakpoints({
		custom: "100rem"
	});
</script>

{#if breakpoints.custom}
	<p>Custom breakpoint</p>
{/if}

If you don't provide any custom breakpoints the default breakpoints from tailwind will be used.

Copy link

changeset-bot bot commented Jun 26, 2025

🦋 Changeset detected

Latest commit: 7716f29

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
runed Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Jun 26, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
runed ✅ Ready (View Log) Visit Preview 7716f29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants