Start sharing components as a team!Share components as a team!Join Bit to build your applications faster.Get Started Free

distribution

v2.6.5arrow_drop_down
v2.6.5
v2.5.5
STATUS
Passing
DOWNLOADS
18
LICENSE
Apache 2.0
VISIBILITY
Public
PUBLISHED
8 months ago
SIZE
34 KB
Proportionally sized grid of boxes. The proportions are approximate. The
1 contributor
Use distribution in your project ?
Copied
npm i @bit/grommet.grommet.distribution
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
Component Example
React
React
Vue
Angular
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
modifieddraft
chevron_left
chevron_right

Distribution

Proportionally sized grid of boxes. The proportions are approximate. The area given to each box isn’t mathematically precise according to the ratio to the total values. Instead, the boxes are laid out in a manner that makes them more visually easy to scan. For example, two values of 48 and 52 will actually each get 50% of the area.

Usage

import { Distribution } from 'grommet';
<Distribution />

Properties

a11yTitle

Custom title to be used by screen readers.

string

alignSelf

How to align along the cross axis when contained in a Box or along the column axis when contained in a Grid.

start
center
end
stretch

gridArea

The name of the area to place this inside a parent Grid.

string

margin

The amount of margin around the component. An object can be specified to distinguish horizontal margin, vertical margin, and margin on a particular side.

none
xxsmall
xsmall
small
medium
large
xlarge
{
  bottom: 
    xxsmall
    xsmall
    small
    medium
    large
    xlarge
    string,
  horizontal: 
    xxsmall
    xsmall
    small
    medium
    large
    xlarge
    string,
  left: 
    xxsmall
    xsmall
    small
    medium
    large
    xlarge
    string,
  right: 
    xxsmall
    xsmall
    small
    medium
    large
    xlarge
    string,
  top: 
    xxsmall
    xsmall
    small
    medium
    large
    xlarge
    string,
  vertical: 
    xxsmall
    xsmall
    small
    medium
    large
    xlarge
    string
}
string

children

Function that will be called when each value is rendered. Defaults to function children(value) { return _react.default.createElement(_Box.Box, { fill: true, border: true }, _react.default.createElement(_Text.Text, null, value.value)); }.

function

fill

Whether the distribution expands to fill all of the available width and height.

boolean

gap

The amount of spacing between child elements. Defaults to xsmall.

xsmall
small
medium
large
xlarge
string

values

Required. Array of objects containing a value. The array should already be sorted from largest to smallest value. The caller can put other properties in the object. The children function will be called to render the contents of each value. Defaults to [].

[{
  value: number
}]

Intrinsic element

div