No Preview

Sorry, but you either have no stories or none are selected somehow.

If the problem persists, check the browser console, or the terminal you've run Storybook from.

Responsive styles

Orbit style props accepts a specialized syntax to support responsive breakpoints.

Usage

By passing an object to any style props, you can specify which style will be applied at different breakpoints. These rules are on a min-width basis meaning that a sm value will apply from 768px and up until another higher breakpoint matches.

Lost in space.

Editable example

Mobile first

Not all breakpoints must be explicitly defined. In the following example, base and lg breakpoints are explicitly declared. When match, the xl breakpoint will implicitly take the value set by the lg breakpoint since it is wider than lg. Everything below lg inherits the base color.

Lost in space.

Editable example

useResponsiveValue

To resolve a responsive value within a React component, Orbit provides the useResponsiveValue hook.

import { useResponsiveValue } from "@sharegate/orbit-ui";
const fluidValue = useResponsiveValue({ base: true, lg: false });

Breakpoints

The following responsive breakpoints are supported by Orbit style props and acts as their CSS media query counterparts:

SizeMedia query
xsmin-width: 640px
smmin-width: 768px
mdmin-width: 1024px
lgmin-width: 1280px
xlmin-width: 1440px