-
Notifications
You must be signed in to change notification settings - Fork 535
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
feat(DataTable): add support for actions and different layouts #2953
Conversation
🦋 Changeset detectedLatest commit: 2ec85f0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
Quick question for you @mperrotti, should the title of the table align to the top edge of the actions container? Or do we want them to be aligned vertically centered? Top-aligned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your CSS is real nice ✨ love the use of grid areas! Stories look nice too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💖
Vertically centered is good. I know PageHeader does top-aligned, but that's because they have a different set of layout problems where vertically-centered is more likely to create weird whitespace. |
const StyledTableContainer = styled.div` | ||
display: grid; | ||
grid-template-columns: 1fr 1fr; | ||
grid-template-areas: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍 great use of grid
Closes https://github.com/github/primer/issues/1889
Add support for the different layouts for a
DataTable
(excluding filter). This adds a couple of stories that show support for the table with both a single action and multiple actions. It also includes support for a footer but this will be implemented by paginationThis PR adds two new components to accomplish this:
Table.Divider
andTable.Actions
. It extendsTable.Container
to be a CSS Grid with different areas for the parts of the table.Feedback
I would love to hear what you all think about this approach for the layout and if there are any other alternatives that I should explore here or that you suggest using!
If folks feel good with this, I'll make sure to add in some quick tests and docs examples for them 👍
Changelog
New
Table.Divider
for rendering a divider in a tableTable.Actions
for rendering a group of actions for a tableChanged
sx
prop toTable.Container
Table.Container
is now a CSS Grid.Table
class name forTable
componentRemoved