Skip to content
14:21
Cell

Cell

Introduction ​

The cell provides a content container for each row of a list, commonly used in settings pages and info lists. It supports title, value, label, icon, arrow, size and grouping.

Examples ​

Basic Usage ​

Use title and value to set the left and right content, and label to add a description below the title.

vue
<m-cell-group>
	<m-cell title="Cell" value="Content" />
	<m-cell title="Cell" value="Content" label="Description" />
</m-cell-group>

Cell Size ​

Use the size attribute to set the cell size, can be set to normal large. The default is normal.

vue
<m-cell title="Cell" value="Content" size="large" />
<m-cell title="Cell" value="Content" label="Description" size="large" />

Left Icon ​

Use the icon attribute to show an icon to the left of the title. Set it to an icon name; no icon is shown when it is null.

vue
<m-cell title="Location" icon="location-o" />
<m-cell title="Shop" icon="shop-o" />

Link and Arrow Direction ​

The is-link attribute shows a right arrow, and arrow-direction controls the arrow direction, can be set to left up down right. The default is right. The clickable attribute controls whether press feedback is shown; it defaults to the value of is-link, and takes precedence once set explicitly.

vue
<m-cell title="Default right arrow" is-link />
<m-cell title="Left arrow" is-link arrow-direction="left" />
<m-cell title="Up arrow" is-link arrow-direction="up" value="Content" />
<m-cell title="Press feedback only" clickable />

Cell Group ​

m-cell-group wraps multiple cells into a group, and the title attribute sets the group title. The inset attribute renders the group as a rounded card with side margins, in which case no outer border is shown. The divider of the last cell in a group is hidden automatically, and can also be forced off with border: false.

vue
<m-cell-group title="Group 1">
	<m-cell title="Cell" value="Content" />
	<m-cell title="Cell" value="Content" />
</m-cell-group>
<m-cell-group inset>
	<m-cell title="Cell" value="Content" />
	<m-cell title="Cell" value="Content" />
</m-cell-group>

Required Star ​

The required attribute shows a required star before the title.

vue
<m-cell title="Phone" required />

API ​

Props ​

PropDescriptionTypeDefault
titleLeft titlestring''
valueRight valuestring''
labelDescription below the titlestring''
sizeSize, can be set to normal largeCellSizenormal
iconLeft icon name, no icon shown when nullIconName | nullnull
borderWhether to show the divider, hidden automatically for the last cell in a groupbooleantrue
centerWhether to center content verticallybooleanfalse
clickableWhether to show press feedback, defaults to the value of isLinkboolean | nullnull
is-linkWhether to show the right arrowbooleanfalse
arrow-directionArrow direction, can be set to left up down rightCellArrowDirectionright
requiredWhether to show the required starbooleanfalse
title-styleCustom inline style of the titlestring-
title-classCustom class name of the titlestring-
value-classCustom class name of the valuestring-
label-classCustom class name of the labelstring-
titleGroup title (CellGroup)string''
insetWhether to be a rounded card group with side margins and no outer border (CellGroup)booleanfalse
borderWhether to show the outer border, not shown in inset mode (CellGroup)booleantrue
custom-classCustom root node class name (Cell and CellGroup)string.ClassString-
custom-styleCustom root node inline style (Cell and CellGroup)string-

Events ​

EventDescriptionParameters
clickEmitted when the cell is clickedevent: MouseEvent

Slots ​

NameDescription
iconLeft icon
titleTitle content (Cell and CellGroup)
labelDescription text
valueRight value
extraExtra content on the right, between the value and the arrow
defaultCell list content (CellGroup)

Theming ​

Cell styles can be customized with the following SCSS variables (define them directly in the project root uni.scss to override the defaults):

VariableDescriptionDefault
$m-cell-font-sizeText font size14px
$m-cell-vertical-paddingVertical padding10px
$m-cell-horizontal-paddingHorizontal padding16px
$m-cell-text-colorTitle text color#323233
$m-cell-backgroundBackground color#fff
$m-cell-border-colorDivider color#ebedf0
$m-cell-active-colorPress feedback background color#f2f3f5
$m-cell-required-colorRequired star color#ee0a24
$m-cell-label-colorLabel text color#969799
$m-cell-label-font-sizeLabel font size12px
$m-cell-value-colorValue text color#969799
$m-cell-icon-marginRight margin of the left icon8px
$m-cell-arrow-marginLeft margin of the arrow4px
$m-cell-right-icon-colorArrow color#c8c9cc
$m-cell-large-vertical-paddingVertical padding of the large size12px
$m-cell-large-title-font-sizeTitle font size of the large size16px
$m-cell-large-label-font-sizeLabel font size of the large size14px
$m-cell-group-backgroundGroup background color (CellGroup)#fff
$m-cell-group-title-colorGroup title color (CellGroup)#969799
$m-cell-group-title-paddingGroup title padding (CellGroup)16px 16px 8px
$m-cell-group-title-font-sizeGroup title font size (CellGroup)14px
$m-cell-group-inset-radiusInset group border radius (CellGroup)8px
$m-cell-group-inset-paddingInset group margin (CellGroup)0 16px

See Theming for the full variable list and override instructions.

Released under the MIT License.