Products · Components

View

A box that lays out what it holds in a column or a row, and can look like a card.

Every page has one View around the rest. Nest more Views to group content into rows, columns and cards.

Children: Components

Example

The View component
view.dml
<View variant="card" direction="row" align="center" justify="between">
  <Text weight="medium">Balance</Text>
  <Text weight="bold" numeric>SLE 1,250.00</Text>
</View>

Props

PropTypeWhat it is
idstringA name for this.captureView, which makes a picture of this View.
hiddenbooleanTakes the View off the screen and keeps what's inside alive, such as a Scroll's position. An <If> removes what's inside, so it starts afresh when it comes back.
disabledbooleanDims the View, and nothing in it takes a tap. Screen readers skip it, so say why outside it.
gapspacing
directioncolumn, row
alignstretch, start, center, endAcross direction.
justifystart, center, end, betweenAlong direction. between puts the first and last child at the ends.
wrapbooleanLets children that don't fit flow onto another line.
growbooleanFills the space the parent has left, along the parent's direction.
padding, paddingTop, paddingStart, paddingEnd, paddingBottomspacingSpace inside its edges, all round or on one side.
variantplain, cardcard is a surface with a hairline and rounded corners. The box props change any of those. Default: plain.
elevationnone, low, highA shadow under the box, so it seems to sit above the page. high is for what floats over others.
backgroundbackground, or a custom color
borderborder
radiuscorner radius
widthfill, or a number of points
heightfill, or a number of points
minHeightnumber
maxWidthnumber
aspectaspect ratio

Events

EventSendsNotes
onTapNothing

Keep reading

On this page