Get boolean for screen size #2221
Answered
by
ljosberinn
ivanjeremic
asked this question in
Q&A
-
Is there any way to get
|
Beta Was this translation helpful? Give feedback.
Answered by
ljosberinn
Oct 12, 2020
Replies: 2 comments 11 replies
-
https://next.chakra-ui.com/docs/hooks/use-breakpoint-value#usage const breakpoint = useBreakpointValue({ base: "base", sm: "sm", lg: "lg", xl: "xl" })
const isBase = breakpoint === 'sm';
// etc |
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
ivanjeremic
-
@ljosberinn I would like to add some conditionals in the props based on the current breakpoint and the methods you showed me and something I found online, but both methods I tried seem to not work correctly always.
So what would you generally recommend, is the way I try to do this in v1 the correct way? Thanks. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://next.chakra-ui.com/docs/hooks/use-breakpoint-value#usage