-
Notifications
You must be signed in to change notification settings - Fork 0
@bynary.composables.observer.Function.useBreakpoint
github-actions[bot] edited this page Jul 11, 2024
·
3 revisions
@bynary/composables / @bynary/composables/observer / useBreakpoint
useBreakpoint(
breakpoint
):Signal
<boolean
>
Creates a signal that tracks whether the given breakpoint matches. Uses the BreakpointObserver under the hood.
• breakpoint: string
Signal
<boolean
>
https://material.angular.io/cdk/layout/overview#breakpoint-observer
const isSmallScreen = useBreakpoint('(max-width: 599px)');
You can also use the predefined breakpoints from Breakpoints:
const isHandset = useBreakpoint(Breakpoints.Handset);
``
@param breakpoint - The breakpoint to match
@returns A signal holding whether the given breakpoint matches
## Defined in
[observer/src/breakpoint.composable.ts:26](https://github.com/bynaryDE/angular-extensions/blob/561225efbb51019451599a0545f4666beb215df3/libs/composables/observer/src/breakpoint.composable.ts#L26)