Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
@kadira/react-storybook-decorator-centered
Advanced tools
React Storybook decorator to center components
React Storybook decorator to center components.
npm i @kadira/react-storybook-decorator-centered
You can set the decorator locally:
import React from 'react';
import { storiesOf } from '@kadira/storybook';
import MyComponent from '../my_component';
import centered from '@kadira/react-storybook-decorator-centered';
storiesOf('MyComponent', module)
.addDecorator(centered)
.add('without props', () => (<MyComponent />))
.add('with some props', () => (<MyComponent text="The Comp"/>));
Or you can also add this decorator globally:
import { configure, addDecorator } from '@kadira/storybook';
import centered from '@kadira/react-storybook-decorator-centered';
addDecorator(centered);
configure(function () {
...
}, module);
1 - Configure the extension
import React from 'react';
import { configure, setAddon } from '@kadira/storybook';
import centered from '@kadira/react-storybook-decorator-centered';
setAddon({
addCentered(storyName, storyFn) {
this.add(storyName, (context) => (
centered.call(context, storyFn)
));
}
});
configure(function () {
...
}, module);
2 - Use it in your story
import React from 'react';
import { storiesOf } from '@kadira/storybook';
import MyComponent from '../my_component';
storiesOf('MyComponent', module)
.addCentered('without props', () => (<MyComponent />))
FAQs
React Storybook decorator to center components
The npm package @kadira/react-storybook-decorator-centered receives a total of 43 weekly downloads. As such, @kadira/react-storybook-decorator-centered popularity was classified as not popular.
We found that @kadira/react-storybook-decorator-centered demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.