Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a Stack Component #9831

Closed
tay1orjones opened this issue Oct 8, 2021 · 3 comments
Closed

Provide a Stack Component #9831

tay1orjones opened this issue Oct 8, 2021 · 3 comments
Assignees
Milestone

Comments

@tay1orjones
Copy link
Member

tay1orjones commented Oct 8, 2021

Since components should no longer have any outside/external "[harmful margin](harmful margin)", there is an even greater need than before for a helper of some type to provide consistent vertical spacing between elements.

The most common solution for this is a Stack component, as popularized by Braid Design System and others.

In essence, this component accepts children and a spacing prop (mapping to our spacing tokens). When rendered, this component will place the spacing amount provided by spacing between the children.

For example:

<Stack spacing="spacing-04">
  <Button>One</Button>
  <Button>Two</Button>
  <Button>Three</Button>
</Stack>

This would render three buttons, each with appropriate margin or padding spacing these equally apart vertically. The first would not have unnecessary top spacing applied, the last would not have unnecessary bottom spacing applied.

We should also update the style guidelines to include a blurb about not using outside margin when styling components.

@joshblack
Copy link
Contributor

@tay1orjones I have some code for this that I can push up in a draft PR real quick 👀

@joshblack
Copy link
Contributor

Link: #9876

@joshblack
Copy link
Contributor

Closed by #9876

@tay1orjones tay1orjones changed the title Provide a helper for vertical spacing Provide a Stack Component Nov 2, 2021
@tay1orjones tay1orjones added this to the v11 Beta 3 milestone Nov 2, 2021
@tay1orjones tay1orjones mentioned this issue Nov 2, 2021
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants