diff --git a/app/composables/use-min-width.ts b/app/composables/use-min-width.ts new file mode 100644 index 00000000..13765ed8 --- /dev/null +++ b/app/composables/use-min-width.ts @@ -0,0 +1,10 @@ +import { getBreakpointValue } from '~/utils/media' + +export type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'vl' | 'xl' | 'xxl' | 'hd' + +/** + * Checks if the viewport width is greater than or equal to the specified breakpoint + */ +export function useMinWidth(breakpoint: Breakpoint) { + return useMediaQuery(`(min-width: ${getBreakpointValue(breakpoint)}px)`) +}