Products · Components

Scroll

A row the person scrolls sideways, such as a shelf of products.

Each child keeps its own width. Give cards a width.

Children: Components

Example

The Scroll component
view.dml
<Scroll gap="small" snap="start">
  <View variant="card" width="140"><Text weight="medium">Airtime</Text></View>
  <View variant="card" width="140"><Text weight="medium">Data</Text></View>
  <View variant="card" width="140"><Text weight="medium">Electricity</Text></View>
</Scroll>

Props

PropTypeWhat it is
gapspacingDefault: medium.
snapnone, start, centerWhere children come to rest after a swipe. Default: none.
indexnumberThe child to scroll to. Changing it scrolls there.
padding, paddingTop, paddingStart, paddingEnd, paddingBottomspacingSpace inside its edges, all round or on one side.

Events

EventSendsNotes
onChange{ index } in detailThe child now at the start.

Keep reading

On this page