
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
rendition
Advanced tools
A library of UI components, built using React, styled-components and styled-system.
npm install --save rendition
Wrap your application in the Provider
component and start using components!
import React from 'react'
import ReactDOM from 'react-dom'
import { Button, Box, Provider } from 'rendition';
ReactDOM.render(
<Provider>
<Box my={3} mx={['auto', 15]}>
<Button primary emphasized>Click me</Button>
</Box>
</Provider>,
document.getElementById('root')
);
For an interactive demo of all components, see https://balena-io-modules.github.io/rendition
Wrap your application in the <Provider>
component so that child components can correctly inherit the default theme. You can optionally provide your own theme.
You can access the theme object in <Provider>
's descendant components using the useTheme
hook:
import React from 'react'
import { useTheme } from 'rendition';
const MyComponent = () => {
const theme = useTheme()
// ...
}
All components support styled-system attributes, allowing you to use a shorthand properties for styling components. The properties can have the properties in the form of string | number | Array<string | number>
. If an array is provided, then a property is chosen based on the width of the screen. The screen width corresponds to a breakpoint set in the theme
property of the Provider
component, by default this is set to [32, 48, 64, 80]
where each number is the screen width in ems.
Name | Type | Description |
---|---|---|
width | ResponsiveStyle | sets the width |
minWidth | ResponsiveStyle | sets the min-width |
maxWidth | ResponsiveStyle | sets the max-width |
height | ResponsiveStyle | sets the height |
minHeight | ResponsiveStyle | sets the min-height |
maxHeight | ResponsiveStyle | sets the max-height |
fontSize | ResponsiveStyle | sets the font size |
display | ResponsiveStyle | sets the display css property |
color | ResponsiveStyle | sets the color css property |
bg | ResponsiveStyle | sets the background css property |
m | ResponsiveStyle | sets the margin css property |
mt | ResponsiveStyle | sets the margin-top css property |
mr | ResponsiveStyle | sets the margin-right css property |
mb | ResponsiveStyle | sets the margin-bottom css property |
ml | ResponsiveStyle | sets the margin-bottom css property |
mx | ResponsiveStyle | sets both the margin-right and margin-left css properties |
my | ResponsiveStyle | sets both the margin-top and margin-bottom css properties |
p | ResponsiveStyle | sets the padding css property |
pt | ResponsiveStyle | sets the padding-top css property |
pr | ResponsiveStyle | sets the padding-right css property |
pb | ResponsiveStyle | sets the padding-bottom css property |
pl | ResponsiveStyle | sets the padding-left css property |
px | ResponsiveStyle | sets both the padding-right and padding-left css properties |
py | ResponsiveStyle | sets both the padding-top and padding-bottom css properties |
*ResponsiveStyle
corresponds to a type of string | number | Array<string | number>
Some components in the storybook
are grouped separately under the Extra
label. These components are not loaded by default
as they rely on other large packages that you may not want to include in your
application.
If you would like to use them they can be loaded using by prefixing the
component name with rendition/dist/extra/
. For example to load the Markdown
components you can use:
import { Markdown } from 'rendition/dist/extra/Markdown';
Please read our contribution guidelines
FAQs
React components library
The npm package rendition receives a total of 4,889 weekly downloads. As such, rendition popularity was classified as popular.
We found that rendition demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.