Comments (5)
@antoinerey You can use decorator.
from storybook.
I get it. But, the component run inside a pure isolated environment where we don't inject any code. So, we shoudn't inject anystuff to change it.
That's how I view about this. Thanks for the request.
from storybook.
@antoinerey You could create a simple component to center the content, something like this:
const Centered = ({ children }) =>
<div style={{ height: "100vh", display: "flex", alignItems: "center", justifyContent: "center" }}>
{children}
</div>
Then just do:
storiesOf("MyComponent", module)
.add("defaults", () => {
return <Centered><MyComponent /></Centered>
})
from storybook.
Yep. That's what I did too. That's why I proposed this idea to be included
into the final solution. :)
Le mer. 6 avr. 2016 à 19:55, Tom Robinson [email protected] a
écrit :
@antoinerey https://github.com/antoinerey You could create a simple
component to center the content, something like this:const Centered = ({ children }) =>
<div style={{ height: "100vh", display: "flex", alignItems: "center", justifyContent: "center" }}>
{children}
Then just do:
storiesOf("MyComponent", module)
.add("defaults", () => {
return
})—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#55 (comment)
from storybook.
I like the idea, this would be great to have! It should be an optional solution though.
from storybook.
Related Issues (20)
- [Bug]: `csf-plugin` fails to read stories with names not matching hardcoded regex HOT 2
- [Bug]: findBy* not working properly in story steps (Angular 17)
- [Bug]: `options: any[]` in argTypes is not sufficient HOT 7
- [Bug]: jsxDEV is not a function on production build with @storybook/react-vite 8.0.7
- [Bug]: viteConfigPath has wrong types.
- [Bug]: Custom .mdx stories not showing code snippet anymore
- [Documentation]: Configure the testing framework for portable stories (With Jest)
- [Bug]: Error installing 7.6.18 HOT 6
- [Bug]: Inconsistent action log when action argument is falsy HOT 1
- [Bug]: The modulesCount cache is writing to disk too much
- [Bug]: error npm install @storybook/[email protected] HOT 1
- [Bug]: Can not install @storybook/node-logger on yarn v3,v4 HOT 4
- [Bug]: toHaveBeenCalledWith does not display expected / received values on failure HOT 1
- [Bug]: Storybook and Radix-vue memory leak
- [Bug]: Can't use enum from external file HOT 1
- [Bug]: can't pass tags array to CSF default export when is generated from a function (v7 AND v8)
- [Bug]: Storybook-build failing on Angular 17 HOT 1
- [Bug]: auto docs doesn't build in static-storybook 8
- [Bug]: chrome / VS Code debugger not working correctly with Storybook 8 (Vite / React) HOT 1
- [Bug]: `@storybook/test` breaks react-native storybook HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from storybook.