RowCard Component Reference

Table of Contents


Introduction

Syntax

tml`
	<RowCard>
		...
	</RowCard>
`

The RowCard component creates a <div> element for a rectangular area for related content within a <Page>. The content is organized as rows of information. Each row may be organized as zero or more pairs of labels and values. The labels and values will be horizontally aligned, if possible.

Typically, the RowCard children are Cr (row) components that, in turn, contain Cl (label) and Cv (value) components. For example:

tml`
	<RowCard title="My card">
		<Cr>
			<Cl>Label 1</>
			<Cv>Value 1</>
		</Cr>
		<Cr>
			<Cl>Label 2</>
			<Cv>Value 2</>
		</Cr>
	</RowCard>
`

Attributes

Using colStyle and rowStyle attributes

The RowCard component uses create a RowCard object in contextProps. The RowCard object contains colStyle and rowStyle as properties. This makes the current colStyle and rowStyle available to any descendant of the RowCard as this.contextProps.RowCard.colStyle or this.contextProps.RowCard.rowStyle.

The RowCard adds two CSS class names to the card <div> (when the attributes are given): rowCard-${rowStyle} and rowCard-${colStyle}. Each Cr row then applies card_row-rowStyle-${rowStyle} and card_row-colStyle-${colStyle} to its own <div>, using its own rowStyle/colStyle if given, else the RowCard's. Applications can use their own CSS to modify the behavior of the built-in style strings, or add new strings. The default CSS behavior for colStyle and rowStyle is described in Cr Component Reference.

Children

Children are normally Cr Components; Crn Components (row notes) are also allowed. The child types are not enforced.

DOM element properties