Skip to content
bahtuiv0.6.0

<baht-list>

Display list with the same server-side contract as baht-table.

Basic

<baht-list></baht-list>

<script>
  const el = document.querySelector('baht-list');
  el.items = [
    {
      "id": "a",
      "title": "Deploy pipeline",
      "subtitle": "Last run 2 min ago",
      "badge": "Running",
      "badgeTone": "success"
    },
    {
      "id": "b",
      "title": "Nightly backup",
      "subtitle": "Last run 6 h ago",
      "badge": "Idle",
      "badgeTone": "neutral"
    },
    {
      "id": "c",
      "title": "Invoice sync",
      "subtitle": "Last run failed",
      "badge": "Failed",
      "badgeTone": "danger"
    }
  ];
</script>
NameTypeDefaultDescription
itemsJSListItem[][]{ id?, title, subtitle?, meta?, badge?, badgeTone? }
loadingbooleanfalseSkeleton rows
errorbooleanfalseError state
error-messagestring"Couldn't load data. Try again."Error text
empty-messagestring'Nothing here yet.'Empty text
skeleton-rowsnumber5Skeletons while loading
clickablebooleantrueItems clickable
EventdetailDescription
nameCustomEvent
baht-item-click{ item, index, id? }Item activated