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]: Boolean prop set to 'false' for subcomponent is not showing up in show code section.
- [Bug]: "Types of property 'typescript' are incompatible" with @storybook/react-webpack5
- [Bug]: Challenges with Rails and import maps
- [Bug]: code blocks not working in mdx HOT 1
- [Bug]: `react-docgen` not correctly populating Description column if props are `Readonly`
- [Bug]: Unable to connect Tailwind CSS
- [Bug]: Interactions-Addon still uses deprecated Button props HOT 1
- [Bug]: Webcomponents with no render function shows empty source code in Canvas
- [Bug]: Parameter with function as value is not available in Manager API
- [Tracking] React-docgen related issues
- [Bug]: Unable to display emails as stories using react-email HOT 1
- [Bug]: @storybook/addon-themes withThemeByDataAttribute decorator not working
- [Bug]: Can't resolve 'next/dist/shared/lib/app-router-context.shared-runtime'
- [Bug]: @storybook/html doesn't support Autodocs HOT 2
- [Documentation]: Missing Vue documentation for Doc Blocks HOT 3
- [Tracking] Module mocking in storybook
- [Bug]: Cannot read properties of undefined (reading 'every') when using essentials addon with typescript HOT 2
- [Documentation]: IS_STORYBOOK env variable is not defined anymore HOT 1
- [Bug]: accidentally ending a title with a `/` breaks storybook HOT 2
- [Bug]: Ember with Storybook 8 doesn't work
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.