npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@blueeast/bluerain-plugin-responsive-components

v1.2.10

Published

A BlueRain Plugin that adds cross platform responsive-layout

Downloads

53

Readme

Bluerain Responsive Components Plugin

This plugin adds responsive components in BlueRainContext. Wrapping page or view in ResponsiveLayout makes it responsive.https://blueeast.gitbook.io/bluerain-plugin-responsive-components

| 🌏 Web | 🖥 Electron | 📱 React Native | | :----------------: | :----------------: | :----------------: | | ✔️ | ✔️ | TBD |

Installation

Run the following command in the plugin directoy:

yarn add  @blueeast/bluerain-plugin-responsive-components

Example

import BR from '@blueeast/bluerain-os';

<BR.Components.ResponsiveLayout default={DesktopComponent}  {...props} />  
  <BR.Components.Container  {...props}>
    <BR.Components.Row  {...props}>
       <BR.Components.Column sm={12} md={6} xs={9} lg={2} xl={2}  {...props}>
      </BR.Components.Column>
    </BR.Components.Row>
  </BR.Components.Container>
</BR.Components.ResponsiveLayout>

Components

This plugin registers following components in BlueRain context:

Column

Props

| Name | Default | Type | Description | | ---------- | ------- | ---------------------------------------- | ------------------------------------------------------ | | xs | | number | The width of the column on extra small screen | | xsOffset | | number | The number of columns to offset on extra small screen | | xsHidden | | boolean | Hide this column on extra small screen | | sm | | number |The width of the column on small screen.| | smOffset | | number | The number of columns to offset on small screen. | | smHidden | | boolean | Hide this column on small screen. | | md | | number | The width of the column on medium screen. | | mdOffset | | number | The number of columns to offset on medium screen. | | mdHidden | | boolean | Hide this column on medium screen. | | lg | | number | The width of the column on large screen. | | mdHidden | | boolean | Hide this column on medium screen. | | lgOffset | | number | The number of columns to offset on large screen. | | lgHidden | | boolean | Hide this column on large screen. | | xl | | number | The width of the column on extra large screen. | | xlOffset | | number | The number of columns to offset on extra large screen. | | xlHidden | | boolean | The number of columns to offset on extra large screen. | | children | | Node | It can wrap another component in itself. | | bluerain | | object | This is used to give bluerain context | | windowSize | | number | It is used to give window size. | | size | | object | Number of columns parent row has. | | gutter | | number | Spacing between 2 columns. |

Container

Props

| Name | Default | Type | Description | | ---------- | ------- | ------ | ------------------------------------- | | bluerain | | object | This is used to give bluerain context | | widths | | number | It Provides width of Container | | windowSize | | number | It is used to give window size | | style | | object | It is used for styling container |

ResponsiveLayout

Props

| Name | Default | Type | Description | | -------- | ------- | ------------------- | ------------------------------------------------------------------------- | | bluerain | | object | This is used to give bluerain context | | widths | | number | It Provides width of Container | | xs | | React.ComponentType | The component to render when the screen size is extra-small | | sm | | React.ComponentType | The component to render when the screen size is small | | lg | | React.ComponentType | The component to render when the screen size is large | | xl | | React.ComponentType | The component to render when the screen size is extra-large | | default | | React.ComponentType | The default component to render, if a current size component is not given |

Row

Props

| Name | Default | Type | Description | | -------------- | ------- | ------- | -------------------------------------------------------------------------------- | | bluerain | | object | This is used to give bluerain context | | windowSize | | number | It is used to give window size | | style | | object | It is used for styling row | | size | | number | Total number of columns this Row can have. Defaults to 12. | | gutter | | number | The gutter width, i.e. padding between columns. Defaults to 30 (15 on each side) | | nowrap | | boolean | Accepts a boolean. This boolean defines the style property flexWrap. | | alignItems | | string | Defines the javascript style property alignItems of the component | | justifyContent | | string | Defines the javascript style property justifyContent of the componen |

WindowInfo

Props

| Name | Default | Type | Description | | ------------------- | ------- | ------ | ----------------------------------------------------- | | setWindowDimentions | | object | This is used to give height and width of the window |

withWindowSize

Props

| Name | Default | Type | Description | | ---------- | ------- | ------ | ----------------------------------------------------- | | windowSize | | object | This is used to give height and width of the window |

Hooks

This plugin adds its functions in following hooks:

bluerain.redux.reducers.bluerain

Window reducers are added through this hook to modify the nested bluerain reducer.

Parameters:

| Name | Type | Description | | --------- | --------------- | ------------------------------ | | reducers | object | Th is contains window size(height and width)|

Returns:

| Name | Type | Description | | --------- | --------------- | ------------------------------ | | WindowReducer | object | This adds window reducer in reducers |

bluerain.redux.initialState

This hook gives the ability to modify the initial state sent to the redux store. Responsive component plugin uses this hook to set initial state of window to bluerain object.

Parameters:

| Name | Type | Description | | --------- | --------------- | ------------------------------ | | initialstate | object |It provides initial state of window|

Returns:

| Name | Type | Description | | --------- | --------------- | ------------------------------ | |window | object |It updates the state of window in reducer to initialstate|

bluerain.redux.middlewares

This plugin adds custom middlewares to the main redux store. The custom middleware takes store as argument, then compares window previous and current sizes. If size is changed, it emits an event with 'plugin.window_info.resize' string.

Parameters:

| Name | Type | Description | | --------- | --------------- | ------------------------------ | | middlewares | object |middlewaresare added in redux store|

Returns:

| Name | Type | Description | | --------- | --------------- | ------------------------------ | |window | object |It updates the state of window in reducer to initialstate of window|

bluerain.system.plugins.initialized

Once the plugins are initialized in the system, Responsive Plugin uses this hook to adjust component layout by comparing the new and old screen dimensions, hence re-renders the component.

Parameters:

| Name | Type | Description | | --------- | --------------- | ------------------------------ | | Component | React.Component |middlewaresare added in redux store|

Returns:

| Name | Type | Description | | --------- | --------------- | ------------------------------ | |Component | React.Component | It is used to render new component with new window size|

API

ResponsiveComponentsPlugin

Properties

  • pluginName string "ResponsiveComponentsPlugin"
  • slug string "responsive-components"