Table

Setup

<script>
  import { Table } from 'svelte-5-ui-lib';
  const tableItems = [
    { name: 'Apple MacBook Pro 17"', color: "Sliver", type: "Laptop", price: "$2999" },
    { name: "Microsoft Surface Pro", color: "White", type: "Laptop PC", price: "$1999" },
    { name: "Magic Mouse 2", color: "Black", type: "Accessories", price: "$99" },
    { name: "Google Pixel Phone", color: "Gray", type: "Phone", price: "$799" },
    { name: "Apple Watch 5", color: "Red", type: "Wearables", price: "$999" }
  ];
</script>

Interactive Table Builder

NameColorTypePrice
Apple MacBook Pro 17"SliverLaptop$2999
Microsoft Surface ProWhiteLaptop PC$1999
Magic Mouse 2BlackAccessories$99
Google Pixel PhoneGrayPhone$799
Apple Watch 5RedWearables$999
<Table {tableItems}
   noborder
 />

Examples

NameColorTypePrice
Apple MacBook Pro 17"SliverLaptop$2999
Microsoft Surface ProWhiteLaptop PC$1999
Magic Mouse 2BlackAccessories$99
Google Pixel PhoneGrayPhone$799
Apple Watch 5RedWearables$999
<script lang="ts">
  import { Table } from 'svelte-5-ui-lib';
  const tableItems = [
    { name: 'Apple MacBook Pro 17"', color: "Sliver", type: "Laptop", price: "$2999" },
    { name: "Microsoft Surface Pro", color: "White", type: "Laptop PC", price: "$1999" },
    { name: "Magic Mouse 2", color: "Black", type: "Accessories", price: "$99" },
    { name: "Google Pixel Phone", color: "Gray", type: "Phone", price: "$799" },
    { name: "Apple Watch 5", color: "Red", type: "Wearables", price: "$999" }
  ];
</script>

<Table {tableItems} hoverable />

Component data