import React from 'react' import { type Meta } from '@storybook/react-vite' import { useIsMobileView } from '..' import { DocsTemplate } from '../../../.storybook' import OutputForDemo from '../../../.storybook/templates/OutputForDemo' export const Example = (): React.JSX.Element => { const isMobileView = useIsMobileView() return (
Determines if the display is mobile sized. {isMobileView.toString()} } />
) } Example.storyName = 'useIsMobileView' Example.args = {} export default { title: 'Hooks/useIsMobileView', component: Example, parameters: { viewMode: 'docs', previewTabs: { canvas: { hidden: true }, }, docs: { page: () => ( <> useIsMobileView is a hook that will run anytime the page is rerendered. , This hook returns a boolean value; true if the page is mobile and false if the page is larger than mobile. , Based on useMediaQuery hook with md as max breakpoint size. , ]} noArgs /> ), }, }, } as Meta