Bluerain Responsive Components Plugin
Last updated
Last updated
This plugin adds responsive components in BlueRainContext. Wrapping page or view in ResponsiveLayout makes it responsive.https://blueeast.gitbook.io/bluerain-plugin-responsive-components
Run the following command in the plugin directoy:
This plugin registers following components in BlueRain context:
This plugin adds its functions in following hooks:
Window reducers are added through this hook to modify the nested bluerain reducer.
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.
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.
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.
🌏 Web
🖥 Electron
📱 React Native
✔️
✔️
TBD
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.
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
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
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
Name
Default
Type
Description
setWindowDimentions
object
This is used to give height and width of the window
Name
Default
Type
Description
windowSize
object
This is used to give height and width of the window
Name
Type
Description
reducers
object
Th is contains window size(height and width)
Name
Type
Description
WindowReducer
object
This adds window reducer in reducers
Name
Type
Description
initialstate
object
It provides initial state of window
Name
Type
Description
window
object
It updates the state of window in reducer to initialstate
Name
Type
Description
middlewares
object
middlewaresare added in redux store
Name
Type
Description
window
object
It updates the state of window in reducer to initialstate of window
Name
Type
Description
Component
React.Component
middlewaresare added in redux store
Name
Type
Description
Component
React.Component
It is used to render new component with new window size