[Stack] Using stack makes children full width by default
See original GitHub issueDuplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
Something seems to be a little fishy with the Stack component. The docs are showing that the children inside stack shouldn’t be full width but opening up CodeSandbox or Blitz that’s provided shows the children are full width by default.
I know you can change the alignment to start
or something, but not everyone knows how Flexbox works and the example doesn’t say anything about it
Expected behavior 🤔
Stack shouldn’t make children full width by default as the docs states.
Steps to reproduce 🕹
Steps:
- Read the docs
- Open the provided links to CodeSandbox or Blitz
- Notice the bug
- Be sad it’s the same in your own project
Context 🔦
No response
Your environment 🌎
`npx @mui/envinfo`
Don't forget to mention which browser you used.
Output from `npx @mui/envinfo` goes here.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
First-child full-width in Flexbox - css - Stack Overflow
You can set the :first-child to a width of 100% , and the rest of the childs :not(:first-child) to flex: 1 . To...
Read more >Flutter : Everything about Stack.. | by Parth Raval - ITNEXT
It works with a combination of parameters - vertical (top, bottom, height) and horizontal (left, right and width) to position the widgets within...
Read more >Stack class - widgets library - Flutter - Dart API docs
A widget that positions its children relative to the edges of its box. This class is useful if you want to overlap several...
Read more >React Stack component - Material UI - MUI
Stack is concerned with one-dimensional layouts, while Grid handles two-dimensional layouts. The default direction is column which stacks children vertically.
Read more >StackPane (JavaFX 8) - Oracle Help Center
The stackpane will attempt to resize each child to fill its content area. ... The default alignment of children within the stackpane's width...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@danilo-leal No I think this should be enough. Now when the demo and example looks the same it won’t get confusing! Closing the issue
Ok, there you go. I managed to adjust the first example without having to deal with the Demo component.
@ImCheesecake Would you say that a “Stack’s children will render full-width by default” mention is still needed given that the demo in the docs and on CodeSanbox will look the same now?