2.0.4 • Published 1 month ago

nuxt-breakpoints-media v2.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

nuxt-breakpoints-media

Nuxt3 or higher module

Module adds to your app easy way to control web page breakpoints

Installation

npm i nuxt-breakpoints-media

Add to modules

// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-breakpoints-media'],
  breakpoints: {
    sm: 576,
    md: 768,
    lg: 992,
    xl: 1200,
  },
})

Usage

const { $bp } = useNuxtApp()
const isSmallThanMd = computed(() => $bp.value.sMd)

Usage with composable

const bp = useBreakpoints()
const isSmallThanMd = computed(() => bp.value.sMd)

Plugin returns a ref value with next props

interface IBreakpoints {
  sm: boolean
  lSm: boolean
  sSm: boolean

  md: boolean
  lMd: boolean
  sMd: boolean

  lg: boolean
  lLg: boolean
  sLg: boolean

  xl: boolean
}

LICENSE

MIT

2.0.4

1 month ago

2.0.3

1 month ago

2.0.2

1 month ago

2.0.1

1 month ago

2.0.0

1 month ago