Only
Specification
"Only" component renders its children according to the media query parameters provided to it via props. By default, it integrates with the configured Layout breakpoints, allowing quick breakpoint references.
Props
Prop name
Prop type
Default value
Description
for
string | Object
–
Exact breakpoint name at which to render the children. Has the highest priority whenever provided.
from
string | Object
–
Starting breakpoint at which to render the children. Can be combined with the other props.
to
string | Object
–
Ending breakpoint at which to render the children. Can be combined with the other props.
except
boolean
false
Flag that controls a notch behavior, when set to true
. Can be combined with the other props.
Example
Explicit breakpoint
High-pass
High-pass is a display model where the content is shown after a specified breakpoint (incl.).
Low-pass
Low-pass is a display model where the content is displayed prior to a specified breakpoint.
Bell
Bell is a combination of low-pass and high-pass display models. The content is displayed starting from a certain breakpoint, and displayed prior to a certain breakpoint.
Notch
Notch is the reversed variant of the Bell behavior: the content is rendered everywhere except the given breakpoints range.
Standalone usage
This component can be used independently from any other components of the library.
Custom breakpoints
Apart from passing defined breakpoint names, you can provide a custom breakpoint Object to the props of this component. The provided breakpoint's options will be used to control the rendering behavior.
Last updated