Data List
Component for organizing and displaying data as a list of key-value pairs.
#
Importimport { DataList } from '@volue/wave-react';
Data List is a compound component that consists of multiple parts.
-
DataList
: A container for all the parts of the data list. -
DataList.Row
: Row that wraps a key-value pair. -
DataList.Label
: Contains the key of the key-value pair. -
DataList.Value
: Contains the value of the key-value pair.
#
Examples#
Basic#
SizesDataList
comes in two sizes: medium
and small
. By default, it uses medium
size.
#
OrientationUse the orientation
prop to change the way the data list is laid out. DataList
supports horizontal (default) and vertical orientations.
Orientation
prop is responsive, meaning it accepts either a single orientation or an object that maps orientation to a breakpoint.
#
Row separationUse the rowSeparation
prop to control the appearance of row separation.
#
Stripes#
Dividers#
Customize column sizesBy default the label column in horizontal orientation extends to accomodate the label and the value column fills the rest of available space.
Use the columnSizes
property, to control the size of the label and value columns in horizontal orientation.
#
Align value to endUse alignValueToEnd
property to align the value to an end of the column in horizontal orientation, useful for numeric or similar data.
Sometimes it makes sense to emphasise the label instead of the data (i.e. if it helps the user to scan more easily for the right information).
Set emphasize
property to label
to give labels more emphasis.
#
API Reference#
DataListProp | Type | Default |
---|---|---|
css | StitchesCss | No default value |
size | enum | "medium" |
orientation | enum | "horizontal" |
columnSizes | [string, string] | No default value |
rowSeparation | enum | No default value |
alignValueToEnd | boolean | false |
emphasize | enum | "value" |
#
DataList.RowProp | Type | Default |
---|---|---|
css | StitchesCss | No default value |
alignItems | enum | No default value |
#
DataList.LabelProp | Type | Default |
---|---|---|
css | StitchesCss | No default value |
#
DataList.ValueProp | Type | Default |
---|---|---|
css | StitchesCss | No default value |