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

distribution

v2.11.1arrow_drop_down
v2.11.1
v2.6.5
v2.5.5
STATUS
Passing
DOWNLOADS
111
LICENSE
Apache 2.0
VISIBILITY
Public
PUBLISHED
7 months ago
SIZE
31 KB
Proportionally sized grid of boxes. The proportions are approximate. The
2 contributors
Install distribution as a package?
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
React Native
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 label to be used by screen readers. When provided, an aria-label will be added to the element.

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,
  end: 
    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,
  start: 
    xxsmall
    xsmall
    small
    medium
    large
    xlarge
    string,
  top: 
    xxsmall
    xsmall
    small
    medium
    large
    xlarge
    string,
  vertical: 
    xxsmall
    xsmall
    small
    medium
    large
    xlarge
    string
}
string

basis

A fixed or relative size along its container’s main axis.

xxsmall
xsmall
small
medium
large
xlarge
xxlarge
full
1/2
1/3
2/3
1/4
2/4
3/4
auto
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.

none
xxsmall
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