
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@strelka/components
Advanced tools
React.js components and storybook for Strelka projects
$ yarn add emotion react-emotion emotion-theming recompose defaults.css @strelka/components
import 'defaults.css'
import { StrelkaThemeProvider, Container, Grid } from '@strelka/components'
const Page = () => (
<StrelkaThemeProvider>
<Container>
<Grid>
<Grid.Cell col={6}> Strelka </Grid.Cell>
</Grid>
</Container>
</StrelkaThemeProvider>
)
Styling props are a special type of props that are used to style components. For example:
import { StrelkaThemeProvider, Div } from '@strelka/components'
const Example = () => (
<StrelkaThemeProvider>
<Div tm='inverted' pd mgM={2} hideT wd={1/3}>
Example content
</Div>
</StrelkaThemeProvider>
)
Here pd, mgM, tm, hideT, wd are styling props that define, correspondingly, paddings, margins, colors, display and width on different screen sizes.
M, T, D are styling props' modifiers for quickly setting styles for specific media query.
Apply media query to styling props.
Not actual prop, but modificator for prop styles (like pd, wd, hide, etc.)
M: (max-width: 768px)T: (min-width: 769px) and (max-width: 1024px)D: (min-width: 1025px)Append to styled prop, then define value: pdM, mgD, hideM.
<StrelkaThemeProvider>
<Div wdT={1/3} pdT hideM mgM={2} />
</StrelkaThemeProvider>
Set margin, padding based on step value in sizes array.
pd — css paddingmg — css marginl — leftr — rightt — topb — bottomx — left and righty — top and bottomNumber, Object10-4Numeric value according to position in sizes array
[ 0, 10, 20, 40, 80 ][ 0, 8, 16, 32, 32 ]<StrelkaThemeProvider>
<Div
mgx={2} // or `mgl={2} mgr={2}`
pdlT={2} // or `pdl={{ T: 1 }}`
pd // same as `pd={1}`
/>
</StrelkaThemeProvider>
Result (styles):
{
marginLeft: 20,
marginRight: 20,
padding: 10,
'@media (min-width: 769px) and (max-width: 1024px):': {
paddingLeft: 20
},
'@media (max-width: 768px)': {
marginLeft: 16,
marginRight: 16,
padding: 8,
}
}
Quickly set width, height in element
wd — css widthminWd — css min-widthmaxWd — css max-widthht — css heightminHt — css min-heightmaxHt — css max-heightNumber, String100%00-1, 1-Infinity, key in theme.sizesIf value smaller then 1, it represents percentage,
i.e.: wd={1/3} is width: 33.3333%, wd={100} is width: 100px
<StrelkaThemeProvider>
<Container>
<Div wd={1/3} wdM={1/2} />
<Div wd={1/3} wdM={1/2} />
<Div wd={1/3} wdM={1} />
<Div ht htM={1/2} />
</Container>
</StrelkaThemeProvider>
Result (styles):
{
width: '33.3333%',
height: '100%',
'@media (max-width: 768px)': {
width: '50%', // or width: '100%' in last div
height: '50%'
}
}
Quickly update display style in element
flex - css 'display: flex'block - css 'display: block'inline - css 'display: inline'inlineBlock - css 'display: inline-block'inlineFlex - css 'display: inline-flex'Booleantrue, false<StrelkaThemeProvider>
<Container>
<Div inlineBlock flexM />
</Container>
</StrelkaThemeProvider>
Result (styles):
{
display: 'inline-block',
'@media (max-width: 768px)': {
display: 'flex'
}
}
Set frequently used styles with shortcut props
hide — css display: nonedebug - { outline: '1px solid {random-color} },outlinepst - { position: 'static' }prl - { position: 'relative' }pab - { position: 'absolute' }pfx - { position: 'fixed' }psy - { position: 'sticky' }l - leftr - rightt - topb - bottomx - left, righty - top, bottomz - z-indexdisplay — displayfloat - floatclear - clear: both || none || valuecf - apply Clearfixbd - borderbdt - border-topbdb - border-bottombdl - border-leftbdr - border-rightradius - border-radiustl - { text-align: left }tc - { text-align: center }tr - { text-align: right }tj - { text-align: justify }op - opacityhop - &:hover { opacity: value }nobr - { white-space: 'nowrap' }ov - ruleValue('overflow', 'auto')ovx - ruleValue('overflow-x', 'auto')ovy - ruleValue('overflow-y', 'auto')ovh - { overflow: 'hidden' }ovsx - { overflow-x: 'auto', overflow-y: 'hidden' }ovsy - { overflow-x: 'hidden', overflow-y: 'auto' }ovtouch - { -webkit-overflow-scrolling: 'touch' }pointerEvents - pointer-events: auto || nonecursortransition - transition: all .3s || valuetransform_hgpu - { transform: 'translateZ(0)' }_hbackface - { opacity: 0.999 }_hoverflow - { overflow: 'hidden' }_hz - { z-index: 9999 }<StrelkaThemeProvider>
<Container df>
<Div tc />
<Div dfo={-1} dib />
</Container>
</StrelkaThemeProvider>
Result (styles):
// Container
{
display: 'flex'
}
// First Div
{
textAlign: 'center'
}
// Next Div
{
order: -1,
display: 'inline-block'
}
Easily set background, text colors based on theme context,
tm — css background-color: bg, color: fg,fg - css colorbg - css background-colorbgi - css background-imagebdc - css border-color,shadow - css box-shadow (only state and color)Numbertrueeducation, primary, bg)Theme can be changed with <ThemePalette /> component (see usage).
<StrelkaThemeProvider>
<Container>
<Div tm />
<Div tm='education' />
<Div bg='primary' />
{/* Change default theme */}
<ThemePalette name='education'>
<Div>
<Div tm />
<Div bg />
<Div bg='primary' />
</Div>
</ThemePalette>
</Container>
</StrelkaThemeProvider>
Result (styles):
// (in order from top to bottom)
// top level <Div>s
{
backgroundColor: colors.WHITE,
color: colors.BLACK
}
// tm='education'
{
backgroundColor: colors.YELLOW,
color: colors.BLACK
}
// bg='primary'
{
backgroundColor: colors.BLUE
}
// inside <ThemePalette name='education'>
// tm
{
backgroundColor: colors.YELLOW,
color: colors.BLACK
}
// bg
{
backgroundColor: colors.YELLOW
}
// bg='primary'
{
backgroundColor: colors.BLACK
}
$ yarn
$ yarn run dev
$ open http://0.0.0.0:3003
Strelka
FAQs
React components and storybook for Strelka projects
The npm package @strelka/components receives a total of 6 weekly downloads. As such, @strelka/components popularity was classified as not popular.
We found that @strelka/components demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.

Product
Bringing supply chain security to the next generation of JavaScript package managers