carbon icon indicating copy to clipboard operation
carbon copied to clipboard

FlatTable to have additional "FlatTableFooter" component

Open PaulSumner-Sage opened this issue 2 years ago • 7 comments

Desired behaviour

We have FLatTableHeader but no FlatTableFooter. Can this be added?

Current behaviour

No ability to use Carbon components to add footer to a FlatTable.

Suggested Solution

new component: FlatTableFooter which will wrap around FlatTableRow in a similar way to native

usage

CodeSandbox or Storybook URL

No response

Anything else we should know?

Confidentiality

  • [X] I confirm there is no confidential or commercially sensitive information included.

PaulSumner-Sage avatar Apr 26 '23 09:04 PaulSumner-Sage

For future triage, currently we support a footer prop for FlatTable, which renders any passed node within a <div> inside the table. This allows us to render text or other components such as Pager just fine, but causes a visual bug when other FlatTable subcomponents like FlatTableCell or FlatTableHeader are passed. Support for these subcomponents would be useful to allow for patterns such as summary rows.

Creating a dedicated FlatTableFooter would be better for consistency with the other FlatTable subcomponents, but we need to clarify if Design System would want to restrict the content placed in the table footer.

Parsium avatar May 02 '23 15:05 Parsium

@Parsium Would you be able to render a FlatTableFooter AND the Pager at the same time? It looks like that could be a requirement.

clairedenning avatar Jun 06 '23 09:06 clairedenning

Hi @clairedenning 👋🏼 I suppose you mean something like in the following image, where we could have pagination and custom content in the table footer?

Screenshot 2023-06-06 at 13 50 52

We would be able to render anything in the footer, but we need to decide what kind of content to allow for - if we want to limit it to just summary rows and pagination, or if there is other content we would like to support.

Parsium avatar Jun 06 '23 12:06 Parsium

I think for now, we're proposing just a summary row, and pagination. But that's not to say that in the future there might be a need for customised content.

clairedenning avatar Jun 06 '23 16:06 clairedenning

Lisa Ying has added a grey "table footer row" to the table in Figma. The table can also have Pagination at the bottom. https://www.figma.com/file/Tau6qv5iyr8wthWNqYktej/DS-Official-Components?type=design&node-id=31496%3A156711&t=HEEr4vsJdZKHoAlS-1 image

clairedenning avatar Jun 07 '23 15:06 clairedenning

Thanks for this @designerlisa @clairedenning! I'll go ahead and create a ticket for us then to implement this into Carbon 👍🏼

Parsium avatar Jun 08 '23 08:06 Parsium

FE-6005

Parsium avatar Jun 08 '23 10:06 Parsium