Skip to content

[EuiBasicTable/Flex layouts] Support for multi line truncation. #7226

@walterra

Description

@walterra

At the moment EUI table columns support truncateText which works great for single lines. An additional option to support multi-line truncation would be great. There's some prior art spread across in Kibana with custom code which looks like there are use cases for both table columns and flex layouts.

Here's an example for custom code for a column's render function for EuiBasicTable using -webkit-line-clamp to achieve multi-line truncation.

    {
      field: 'myField',
      name:'My field',
      render: (value) => {
        return (
          <div
            css={css`
              display: -webkit-box;
              line-clamp: 3;
              -webkit-line-clamp: 3;
              -webkit-box-orient: vertical;
              overflow: hidden;
            `}
          >
            {value}
          </div>
        );
      },
      truncateText: false,
      valign: 'middle',
    },

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions