diff --git a/CHANGELOG.md b/CHANGELOG.md index 380a8450b19..0a200c0e771 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - `EuiForm` and `EuiFormRow` now accept nodes for `errors` prop ([#685](https://github.com/elastic/eui/pull/685)) - Removed the default `max-width` from `EuiText`. This can still be applied by setting `grow={false}` ([#683](https://github.com/elastic/eui/pull/683)) - Added support for text alignment with `EuiTextAlign` ([#683](https://github.com/elastic/eui/pull/683)) +- `EuiBasicTable` added the `compressed` prop to allow for tables with smaller fonts and padding. ([#687](https://github.com/elastic/eui/pull/687)) **Breaking changes** diff --git a/src-docs/src/views/tables/basic/props_info.js b/src-docs/src/views/tables/basic/props_info.js index b2889297828..941d5e8a30a 100644 --- a/src-docs/src/views/tables/basic/props_info.js +++ b/src-docs/src/views/tables/basic/props_info.js @@ -8,6 +8,10 @@ export const propsInfo = { required: true, type: { name: 'object[]' } }, + compressed: { + description: 'Makes the font and padding smaller for the entire table', + type: { name: 'bool' } + }, columns: { description: 'Defines the table columns', required: true, diff --git a/src/components/basic_table/basic_table.js b/src/components/basic_table/basic_table.js index 2e9e0ef761f..f26e5128063 100644 --- a/src/components/basic_table/basic_table.js +++ b/src/components/basic_table/basic_table.js @@ -137,7 +137,8 @@ const BasicTablePropTypes = { error: PropTypes.string, loading: PropTypes.bool, noItemsMessage: PropTypes.node, - className: PropTypes.string + className: PropTypes.string, + compressed: PropTypes.bool, }; export class EuiBasicTable extends Component { diff --git a/src/components/basic_table/in_memory_table.js b/src/components/basic_table/in_memory_table.js index cc7146396d8..7725daa2b02 100644 --- a/src/components/basic_table/in_memory_table.js +++ b/src/components/basic_table/in_memory_table.js @@ -23,6 +23,7 @@ const InMemoryTablePropTypes = { loading: PropTypes.bool, message: PropTypes.node, error: PropTypes.string, + compressed: PropTypes.bool, search: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({ defaultQuery: QueryType, box: PropTypes.shape({ @@ -255,6 +256,7 @@ export class EuiInMemoryTable extends Component { selection, isSelectable, hasActions, + compressed, pagination: hasPagination, sorting: hasSorting, } = this.props; @@ -302,6 +304,7 @@ export class EuiInMemoryTable extends Component { error={error} loading={loading} noItemsMessage={message} + compressed={compressed} /> );