Community project. This is not an official government website.

Run by volunteers. Lampung Design System is built by an open source community. No government agency runs or endorses it.

Official services use go.id. Government websites in Indonesia end in .go.id. Never enter your national ID number on a site you are unsure of.

Product tile

Product tile

A product people tap to add to a sale or an order: picture, name, one meta line and the price, with a badge in the corner that counts how many are already in the sale. The whole tile is one button.

Usage

Use it when

  • A point of sale or a counter where the cashier adds products by tapping them: a shop, a cafe, a ticket desk.
  • A self-order screen or a menu where people build an order from a grid of items.
  • Any grid where one tap adds one item and the running count matters more than the details.

Use something else when

  • Browsing products to open their page: use Card. Use a linked card (card--link); a product tile adds, it does not navigate.
  • Managing a catalog: editing, stock, status: use Data table.
  • Choosing one plan or package with a description: use Radio card.
  • Files and folders: use File tile.

Where it goes. In a .ptile-grid (columns of at least --min, 148 px by default) beside or above the current sale. On phones two columns of tiles fill the width; .ptile--compact puts the picture beside the name for long lists or narrow side panels.

Examples

A point-of-sale gridThe count in the corner and the accent ring say what is already in the sale; low stock is said in words; the sold-out tile fades and says when it is back.
<div class="ptile-grid">
  <button class="ptile is-in" type="button" aria-label="Stoneware mug, set of 2, $36.00, 2 in this sale">
    <span class="ptile__media"><img src="img/products/stoneware-mug.svg" alt=""></span>
    <span class="ptile__body"><span class="ptile__name">Stoneware mug, set of 2</span><span class="ptile__meta">36 in stock</span></span>
    <span class="ptile__price">$36.00</span>
    <span class="ptile__qty">2</span>
  </button>
  <button class="ptile" type="button" aria-disabled="true" aria-label="Field watch, 38 mm, $189.00, sold out">…<span class="ptile__meta">Sold out until 2 Dec</span>…</button>
</div>
<script type="module">
  // On tap: add to the sale, then show the count and pop it
  qty.hidden = false; qty.textContent = n; qty.classList.remove('is-bump'); void qty.offsetWidth; qty.classList.add('is-bump');
</script>
Compact, in a narrow panelptile--compact puts the picture beside the name: for a side panel, quick picks or a long list on a phone.
<div class="ptile-grid" style="--min: 240px; max-width: 520px;">
  <button class="ptile ptile--compact" type="button" aria-label="Organic cotton crew tee, $29.00"><span class="ptile__media"><img src="../examples/dashboard/img/products/crew-tee.svg" alt=""></span><span class="ptile__body"><span class="ptile__name">Organic cotton crew tee</span><span class="ptile__meta">S, M, L</span></span><span class="ptile__price">$29.00</span><span class="ptile__qty" hidden></span></button>
  <button class="ptile ptile--compact is-in" type="button" aria-label="Dot grid notebook, A5, $18.00, 1 in this sale"><span class="ptile__media"><img src="../examples/dashboard/img/products/dot-notebook.svg" alt=""></span><span class="ptile__body"><span class="ptile__name">Dot grid notebook, A5</span><span class="ptile__meta">120 in stock</span></span><span class="ptile__price">$18.00</span><span class="ptile__qty">1</span></button>
</div>

Anatomy

PartWhat it is
button.ptileRequired. The whole tile; aria-label says the name, the price and how many are in the sale.
.ptile__mediaRequired. A square picture (img, alt empty because the label names the product) or a 32 px icon when there is no photo. --ratio changes the shape.
.ptile__nameRequired. Two lines at most, then it clips.
.ptile__metaOptional. Stock, size or variant. .ptile__meta--low for low stock, in words.
.ptile__priceRequired. Tabular, at the bottom so prices line up across a row.
.ptile__qtyOptional. How many are in the current sale; hidden at zero. Add .is-bump again to pop it when the count changes.
.is-inThe product is in the sale: an accent ring.
[aria-disabled="true"]Sold out or not for sale now: the picture fades, the meta line says why.

Variants and sizes

Class or attributeWhen
.ptilePicture on top; the default for grids.
.ptile--compactPicture at the start, 56 px; for narrow panels and long lists.
.ptile-gridThe grid; set --min for the smallest column width.

States

StateHow
hoverThe ring darkens and the picture grows 4 %.
pressedSinks to 0.97 in 90 ms, back on --spring-snappy.
in the sale.is-in accent ring and the .ptile__qty count.
sold outaria-disabled="true": faded picture and muted text; the meta line says when it is back. A tap shakes the tile and announces why.
loadingA grid of tiles with a square .skel and two text bars.

Motion and microinteractions

  • Press: scale(0.97) in 90 ms, released on --spring-snappy (360 ms).
  • The count pops in from 0.6 on --spring-snappy; each change re-plays lds-pop from 0.82 so a fast run of taps stays readable.
  • Hover grows the picture on --spring-smooth; nothing moves on touch screens.
  • Reduced motion: no pop and no scale; the count and ring change at once.

Accessibility

  • A real button; aria-label carries the name, the price and the count ("Stoneware mug, $36.00, 2 in this sale"). Update it when the count changes.
  • Use aria-disabled rather than disabled for sold out, so the tile stays focusable and can explain itself.
  • Announce each add through a polite live region ("Added Stoneware mug, 2 in the sale").
  • Tiles are at least 148 px wide, far above the 44 px target.

Do and don't

Do

  • Show the price on every tile; cashiers compare by price.
  • Keep a running total of the sale in view beside or under the grid.

Don't

  • Put extra buttons inside the tile; quantity changes belong to the sale lines.
  • Hide sold-out products silently; show them disabled with the reason.