v1.0.11

Hidden

Installation

Install yarn add @spark-web/hidden
Source GitHub.com
Bundle unpkg.com

Conditionally display content for different screen sizes and media types.

Hidden below wide
Visible below wide

Examples

Responsive

Hide content responsively using the above and below props, which accept a breakpoint name.

1. Hidden below wide
2. Hidden below desktop
3. Hidden below tablet
4. Hidden above mobile
5. Hidden above tablet
6. Hidden above desktop

Print

Conditionally display content for print using the on prop.

Hidden on screen
Hidden on print

Props

PropTypeDescription

children

ReactNode: string | number | false | true | {} | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal

Children elements to be conditionally rendered.

above?

"mobile" | "tablet" | "desktop"

Sets the screen width floor breakpoint the elements should be hidden.

below?

"tablet" | "desktop" | "wide"

Sets the screen width ceiling breakpoint the elements should be hidden.

data?

DataAttributeMap

Sets data attributes for the element.

inline?

boolean

Sets whether element should be rendered in-line or on a new line.

on?

"screen" | "print"

Sets on what type of device element should be hidden.

@see https://developer.mozilla.org/en-US/docs/Web/CSS/@media#media_types

© 2023 Brighte Capital Pty Ltd