Getting started

On this page you will learn how to create a datagrid.

Data

There is no datagrid without data! In order not to complicate this example, we will use predefined data, which will look as follows:

{ 
    "index": 1, 
    "product": { 
        "name": "Sprouts - Onion" 
    },
    "quantity": 972, 
    "price": 261.51, 
    "expiration_date": "7/14/2024", 
    "manufacturer": "Green Factory", 
    "category": "vegetables", 
    "location": "Apt 1819", 
    "barcode": 3056519006086, 
    "weight": 25.6, 
    "supplier": "Foodgast", 
    "id": "a0473d74-06e7-4dd0-8bb3-a17f16c94180" 
}

There are no special requirements how your data looks like, as you can see the data can be nested, it does not have to be a flat structure.

Defining columns

Second step in creating a datagrid will be to define columns.

import type { BaseColumn } from "$lib/datagrid/types";
import type { InventoryDataRow as Row } from "$lib/data/inventory";

export const columns = [
    {
        id: 'product.name',
        title: 'Product name',
        grow: true
    },
    {
        id: 'price',
        title: 'Price',
    },
] satisfies BaseColumn<Row>[]

BaseColumn is a generic type. Give it the your data shape to get typesafety in column definition. (nested data at this point gives no intelisense)

Important

Columns id and title are required

Datagrid columns does not always behave like table columns, they have specified width. You can set your own width in columns definition with width. Eg. width:"300px". In some scenarios I believe that adding grow to particular column is a better idea. Either first or last column is good candidate, or you can make any other most important column grow to fill the available space.

Important

You can specify width and grow to multiple columns

A good practice is to place the columns in a separate file. This makes our main component look neater.

Datagrid instance

Svelte 5 allows you to define stores outside of .svelte files as a class. Datagrid takes advantage of this capability.

Import the class and create an instance of it inside the context.

let datagrid = setContext(
    `datagrid`,
    new TzezarDatagrid({
        data,
        columns,
    })
);

New instance of datagrid requires a columns and data.

As you will see typesafety is preserved during the creation of datagrid later in the code.

Important

context has to be named "datagrid"

Rendering our datagrid

Now it's time to render our datagrid. Relax, it's easy.
<Datagrid.Datagrid>
	{#snippet head()}
		{#each datagrid.columns as column (column.id)}
			<Datagrid.Header {column} />
		{/each}
	{/snippet}
	{#snippet body()}
		{#each datagrid.data as row, rowIndex}
			<Datagrid.Row {rowIndex}>
				{#each datagrid.columns as column, columnIndex}
					<Datagrid.Cell {columnIndex} {rowIndex} {column} {row} />
				{/each}
			</Datagrid.Row>
		{/each}
	{/snippet}
</Datagrid.Datagrid>

I'll explain what's going on here in a moment. I encourage you later to read the rest of the documentation to more in-depth understand the operation and why it looks this way.

<Datagrid.Datagrid>

This wrapper contains the basic datagrid logic and styling to give the datagrid the proper structure. It has two main slots: head and body. Suprisingly, they are optional — let me explain. In the future, the datagrid will support a headless mode, allowing for any arrangement of elements within the datagrid. However, using the provided snippets is recommended (at least for now).

The head slot is used to render header elements, while the body slot is used to render data elements. Inside head, we have the ability to display header cells, render custom elements, and show column filters. So, for each header, we render a

<Datagrid.Header>

which contains styling and logic for things like sorting. column is typed, which will make things easier in later examples. Inside the body slot, we display data cells. For each row, we display an element.

<Datagrid.Row>

Notice that we used datagrid.data and not our own data we provided, because the data logic is applied within the datagrid. At this point, I want you to know that the datagrid provides, among other things:

datagrid.internal.sortedData datagrid.internal.filteredData datagrid.internal.paginatedData

The first two probably won't be useful to you, but datagrid.paginatedData is used to display rows split into pages, with sorting and filtering logic applied.

Again, <Datagrid.Row> includes both styling and logic. Inside each row, we need to display the corresponding data cells. Therefore, we iterate over datagrid.columns. It is important to use the columns returned by the datagrid and not the ones we defined earlier. Then, we render a cell by passing a few props.

<Datagrid.Cell>

The cell is wrapped with logic, and even custom elements should later be displayed inside it (or another sibling cell element - more later) using custom slot.

Both row and column are typed, which significantly improves the developer experience (DX) and makes applying custom styles easier. Check the feature guides to learn more about rendering custom cells or how to apply logic and styles to selected cells or rows.

Congratulations!

You've just built your first datagrid—what an achievement! Creating a powerful and flexible grid like this is a huge step forward, and you’ve done a fantastic job bringing it to life.

But this is just the beginning! There’s so much more you can do to enhance your datagrid. The feature guides are packed with tips on how to customize cells, apply unique styles, and introduce advanced logic to your rows and columns. The possibilities for fine-tuning and optimizing your grid are endless.

So keep going! Experiment with new ideas, explore the documentation, and continue to build upon what you’ve already accomplished. You’re on a great path, and I’m excited to see what you’ll create next!

Product name
Price
Sprouts - Onion
261.51
Beer - True North Lager
191.32
Milk - Condensed
826.1
Brandy Cherry - Mcguinness
555.07
Olive - Spread Tapenade
506.45
Tea - Black Currant
750.65
Coconut Milk - Unsweetened
658.56
Nut - Walnut, Pieces
763.42
Apple - Northern Spy
81.35
Orange - Canned, Mandarin
939.59
Veal - Brisket, Provimi,bnls
353.49
Wine - Ice Wine
867.85
Table Cloth 54x72 White
703.86
Wine - Cotes Du Rhone Parallele
967.56
Wine - Duboeuf Beaujolais
247.42
Carrots - Jumbo
880.11
Wine - Touraine Azay - Le - Rideau
949.68
Schnappes Peppermint - Walker
879.93
Wine - Champagne Brut Veuve
496.79
Appetizer - Smoked Salmon / Dill
274.6
Campari
138.14
Smoked Paprika
457.74
Soup - Tomato Mush. Florentine
75.56
Yogurt - Strawberry, 175 Gr
587.04
Wine - Red, Cooking
889.99
Tea - Darjeeling, Azzura
383.47
Temperature Recording Station
306.87
Juice - Happy Planet
952.35
Glass - Juice Clear 5oz 55005
498.95
Capers - Ox Eye Daisy
897.46
Turkey Leg With Drum And Thigh
26.08
Wine - Beringer Founders Estate
455.37
Wine - Chardonnay South
338.28
Cocktail Napkin Blue
420.85
Arctic Char - Fillets
407.78
Spice - Peppercorn Melange
974.88
Island Oasis - Mango Daiquiri
265.21
Veal - Slab Bacon
976.44
Hot Chocolate - Individual
347.85
Eggwhite Frozen
435.32
Cheese - Gouda
452.15
Cattail Hearts
664.81
Squash - Pepper
376.91
Shrimp - Black Tiger 6 - 8
332.96
Wine - Mas Chicet Rose, Vintage
94.3
Island Oasis - Mango Daiquiri
374.05
Mint - Fresh
772.92
Butter - Unsalted
606.6
Straw - Regular
830.06
Blackberries
220.54
Muffin Orange Individual
647.2
Towel Multifold
758.44
Wonton Wrappers
604.54
Ice Cream Bar - Oreo Cone
925.27
Table Cloth 54x72 Colour
189.14
Longos - Grilled Salmon With Bbq
951.39
Lamb - Whole, Frozen
841.82
Pate - Liver
598.31
Island Oasis - Sweet And Sour Mix
78.02
Wine - Cotes Du Rhone
204.03
Curry Powder Madras
784.63
Tarts Assorted
849.94
Everfresh Products
454.66
Chicken - Diced, Cooked
410.65
Burger Veggie
290.72
Schnappes Peppermint - Walker
852.65
Muffin Orange Individual
116.78
Flavouring - Raspberry
365.36
Hummus - Spread
20.7
Chicken - Leg / Back Attach
213.59
Chicken - Whole Fryers
521.23
Cookies - Oreo, 4 Pack
413
Wine - Pinot Grigio Collavini
904.75
Napkin - Beverage 1 Ply
789.18
Beef - Kindney, Whole
798.52
Crush - Grape, 355 Ml
548.95
Arizona - Green Tea
38.26
Rice - 7 Grain Blend
669.46
Carbonated Water - White Grape
420.41
Vinegar - Rice
719.41
Avocado
886.91
Cookies - Amaretto
596.26
Turkey - Breast, Bone - In
474.78
Mushroom - Chanterelle Frozen
889.74
Cake - Mini Cheesecake
721.23
Cup - Paper 10oz 92959
567.7
Chick Peas - Canned
6.33
Cake Circle, Paprus
991.67
Mace Ground
853.95
Ocean Spray - Kiwi Strawberry
270.3
Coffee - Flavoured
836.14
Liqueur - Melon
788.87
Extract - Raspberry
732.29
Rambutan
334.04
Lime Cordial - Roses
221.35
Noodles - Cellophane, Thin
360.71
Capers - Pickled
904.98
Durian Fruit
467.68
Jack Daniels
755.17
Cheese - St. Paulin
545.3
Bread Base - Gold Formel
491.43
Basil - Thai
913.37
Calypso - Lemonade
26.34
Spice - Chili Powder Mexican
41.2
Munchies Honey Sweet Trail Mix
115.48
Fondant - Icing
23.07
Wine - White, Ej
299.21
Rabbit - Legs
887.44
Rum - Light, Captain Morgan
102.1
Apple - Macintosh
19.03
Salmon - Atlantic, No Skin
117.88
Rice - Aborio
270.43
Spic And Span All Purpose
111.33
Smirnoff Green Apple Twist
151.07
Puree - Raspberry
204.17
Soup Campbells - Italian Wedding
29.87
Pear - Packum
216.37
Chips - Miss Vickies
691.88
Soup Campbells Beef With Veg
797.83
Huck White Towels
216.62
Skewers - Bamboo
390.55
Wine - Sogrape Mateus Rose
526.12
Cookie Dough - Peanut Butter
457.65
The Pop Shoppe - Grape
728.53
Cactus Pads
303.69
Chilli Paste, Hot Sambal Oelek
11.33
Olive - Spread Tapenade
630.04
Glass - Juice Clear 5oz 55005
683.23
Nut - Almond, Blanched, Ground
663.94
Cornstarch
185.79
Noodles - Steamed Chow Mein
785.92
Sobe - Liz Blizz
774.45
Trout - Hot Smkd, Dbl Fillet
438.55
Pork - Belly Fresh
28.71
Beer - Mcauslan Apricot
13.94
Bread - Dark Rye, Loaf
859.01
Bread - Bistro White
580.38
Quinoa
739.07
Ham - Cooked Bayonne Tinned
424.44
Mikes Hard Lemonade
675.79
Icecream Cone - Areo Chocolate
839.34
Glaze - Clear
199.91
Ocean Spray - Ruby Red
724.56
Wine - Prosecco Valdobienne
44.37
Beef - Ox Tongue
641.63
Soup - Tomato Mush. Florentine
733
Sproutsmustard Cress
159.5
Wheat - Soft Kernal Of Wheat
188.88
Venison - Ground
963.3
Beef - Tongue, Cooked
863.51
Wine - Merlot Vina Carmen
146.65
Arctic Char - Fresh, Whole
993.42
Cheese - Camembert
773.53
Lid - 0090 Clear
330.32
Steamers White
454.21
Lychee - Canned
942.67
Energy Drink - Redbull 355ml
339.28
Cookie Choc
375.68
Bagel - Whole White Sesame
827.61
True - Vue Containers
700.84
Snails - Large Canned
36.57
Pears - Bartlett
171.24
Pepper - Sorrano
256.46
Shortbread - Cookie Crumbs
570.33
Corn Meal
451.85
Sour Puss - Tangerine
40.02
Sugar - Splenda Sweetener
578.21
Soup - Campbells, Spinach Crm
662.54
Arrowroot
885.73
Soup - Cream Of Potato / Leek
705.13
Table Cloth 62x120 Colour
646.39
Bread - Kimel Stick Poly
423.73
Gatorade - Lemon Lime
502.9
Glaze - Clear
445.14
Sauce - Chili
3.38
Fish - Base, Bouillion
320.17
Croissant, Raw - Mini
215.44
Cod - Salted, Boneless
508.38
Tabasco Sauce, 2 Oz
724.04
Crackers - Melba Toast
556.85
Eggroll
961.52
Oil - Coconut
636.06
Pheasants - Whole
107.67
Energy Drink Red Bull
378.89
Spinach - Baby
230.01
Egg Patty Fried
997.44
Onions - White
587.23
Dikon
894.89
Chocolate - Milk, Callets
891.04
Mushroom - Chanterelle, Dry
723.12
Yucca
902
Wine - Red, Metus Rose
40.38
Yukon Jack
898.98
Longos - Grilled Salmon With Bbq
153.55
Capon - Breast, Wing On
528.92
Appetizer - Chicken Satay
545.13
Pastry - Carrot Muffin - Mini
866.38
Sugar - Individual Portions
903.54
Cream - 18%
418.85
Arctic Char - Fresh, Whole
623
Dried Cherries
157
Beef Striploin Aaa
717.4
Veal - Knuckle
191.11
Potatoes - Idaho 100 Count
389.51
Chinese Foods - Chicken
568.42
Coconut - Shredded, Sweet
491.09
Knife Plastic - White
758.38
Cheese - Bakers Cream Cheese
761.45
Cheese - Havarti, Salsa
605.67
Flour - Strong Pizza
422.26
Cheese - Colby
576.52
Cabbage - Green
490.28
Truffle Paste
727.56
Veal - Liver
844.64
Mousse - Passion Fruit
432.69
Flower - Dish Garden
306.39
Vermouth - Sweet, Cinzano
167.47
Muffin Puck Ww Carrot
895.83
Eggs - Extra Large
274.31
Gloves - Goldtouch Disposable
834.31
Juice - Orange, Concentrate
494.57
Oil - Macadamia
302.52
C - Plus, Orange
83.08
Tortillas - Flour, 10
174.32
Momiji Oroshi Chili Sauce
187.18
Pork - Shoulder
638.46
Mustard - Pommery
613.06
Dc - Frozen Momji
471.93
Liqueur - Melon
454.96
Spoon - Soup, Plastic
684.42
Mousse - Passion Fruit
982.1
Plasticspoonblack
395.98
Wine - Red, Cooking
405.83
Garlic - Elephant
230.86
Flavouring - Raspberry
74.57
Blueberries
177.22
Container - Clear 16 Oz
573.05
Veal - Knuckle
903.45
Bagel - Plain
889.16
Flour - Chickpea
584.04
Carbonated Water - Cherry
408.88
Napkin Colour
237.36
Chips - Assorted
258.11
Nut - Pistachio, Shelled
437.7
Pepper - Cayenne
777.3
Cheese - Feta
731.72
Rum - White, Gg White
611.32
Pears - Bosc
90.98
Wine - Pinot Noir Pond Haddock
223.33
Sambuca - Opal Nera
649.46
Wine - Marlbourough Sauv Blanc
574.06
Wine - Winzer Krems Gruner
367.06
Pepper - Chilli Seeds Mild
362.6
Cookies - Englishbay Wht
97.72
Vinegar - Balsamic, White
941.7
Brandy Apricot
140.82
Vinegar - Balsamic
693.94
Truffle Cups - Red
280.95
Carrots - Purple, Organic
148
Foil Cont Round
699.21
Cheese - Comtomme
308.57
Muffin Mix - Carrot
921.99
Cake Slab
956.83
Oil - Hazelnut
319.75
Rhubarb
275.73
Mangostein
26.17
Roe - Lump Fish, Red
697.33
Pickles - Gherkins
405.2
Pork - Kidney
689.22
Bread - Roll, Canadian Dinner
599.19
Veal - Inside Round / Top, Lean
554.06
Lettuce - Treviso
501.49
Squid Ink
352.75
Fudge - Cream Fudge
218.93
Pasta - Rotini, Colour, Dry
700.6
Marjoram - Dried, Rubbed
711.54
Huck White Towels
497.45
Pants Custom Dry Clean
346.51
Truffle Cups Green
702.82
Mince Meat - Filling
273.09
Beef - Tenderloin Tails
517.3
Table Cloth 54x54 Colour
826.63
Beef - Ox Tongue
31.07
Wine - Shiraz Wolf Blass Premium
264.09
Tea - Mint
828.43
Napkin - Beverage 1 Ply
728.79
Sauce - Hoisin
628.39
Lettuce - Iceberg
811.02
Beer - Molson Excel
656.49
Vinegar - Rice
992.89
Paper Cocktail Umberlla 80 - 180
309
Sauce - White, Mix
852.11
Beans - Butter Lrg Lima
617.39
Cream - 18%
53.19
Beef - Bones, Marrow
817.41
Sour Puss Raspberry
945.62
Lettuce - Boston Bib - Organic
818.77
Wine - Vidal Icewine Magnotta
939.1
Pastry - Raisin Muffin - Mini
176.73
Wine - White, Antinore Orvieto
282.58
Wine - Crozes Hermitage E.
197.52
Crackers Cheez It
275.83
Gin - Gilbeys London, Dry
786.71
Cardamon Seed / Pod
872.14
Rosemary - Primerba, Paste
131.52
Flour Dark Rye
254.66
Chinese Lemon Pork
727.57
Grapefruit - White
210.83
Potatoes - Instant, Mashed
179.85
Dawn Professionl Pot And Pan
423.72
Juice - Cranberry, 341 Ml
21.66
Bread - Italian Corn Meal Poly
778.54
Oregano - Fresh
161.55
Puree - Strawberry
843.03
Potatoes - Idaho 100 Count
460.67
Lettuce - Sea / Sea Asparagus
657.99
Rice Wine - Aji Mirin
116.43
Zucchini - Yellow
129.48
Mushroom - Enoki, Fresh
410.82
Beef Ground Medium
478.57
Lemon Grass
376.3
Octopus
410.74
Bread Base - Gold Formel
451.72
Fuji Apples
91.1
Uniform Linen Charge
738.84
Chilli Paste, Sambal Oelek
59.59
Trout - Smoked
561.89
Pie Filling - Cherry
994.95
Bread - Rosemary Focaccia
770.73
Parasol Pick Stir Stick
862.18
Clam Nectar
782.8
Soup - French Can Pea
602.89
Asparagus - Green, Fresh
348.16
Sauce - Demi Glace
181.05
Pepper - Green
441.65
Pasta - Bauletti, Chicken White
578.94
Chinese Foods - Pepper Beef
519.22
Bag - Regular Kraft 20 Lb
412.15
Chips - Miss Vickies
883.77
Doilies - 7, Paper
453.29
Vinegar - Cider
950.98
Tomatoes - Roma
81.55
Island Oasis - Cappucino Mix
315.84
Syrup - Kahlua Chocolate
884.92
Brandy - Orange, Mc Guiness
86.5
Pasta - Fettuccine, Egg, Fresh
96.15
Red Currants
135.29
Creme De Cacao Mcguines
220.02
Coconut - Whole
844.61
Grapefruit - White
708.7
Ostrich - Prime Cut
248.89
Pasta - Lasagna, Dry
989.59
Wine - Shiraz Wolf Blass Premium
195.19
Salami - Genova
373.04
Clams - Littleneck, Whole
624.5
Fuji Apples
770.55
Lobster - Tail, 3 - 4 Oz
994.89
Gatorade - Fruit Punch
996.88
Bonito Flakes - Toku Katsuo
591.26
Chips - Assorted
693.46
Seedlings - Clamshell
670.75
Eggplant - Asian
129.18
Soup - Campbells, Beef Barley
152.4
Vinegar - Sherry
314.92
Lamb - Whole Head Off,nz
818.27
Cheese - Comtomme
560.27
Sword Pick Asst
460.97
Soup - Verve - Chipotle Chicken
863.36
Butter Ripple - Phillips
723.88
Chicken - Base
85.06
Lettuce - Frisee
758.42
Pasta - Cannelloni, Sheets, Fresh
331.64
Jam - Raspberry,jar
27.24
Tofu - Soft
66.74
Sausage - Liver
315.19
Bag Stand
735.39
Shrimp - Black Tiger 26/30
710.93
Mop Head - Cotton, 24 Oz
711.93
Spic And Span All Purpose
47.78
Wine - Zinfandel Rosenblum
129.34
Pork - Bacon, Double Smoked
9.23
Bread - Rolls, Corn
726.77
Thermometer Digital
185.02
Shrimp - Black Tiger 26/30
660.87
Chicken - Tenderloin
895.79
Oil - Cooking Spray
623.47
Basil - Thai
343.81
Table Cloth 54x72 Colour
481.65
Jam - Raspberry
397.34
Crawfish
257.39
Wine - Red, Pelee Island Merlot
383.95
Spinach - Frozen
440.53
Carbonated Water - Lemon Lime
51.87
Syrup - Kahlua Chocolate
23.47
Wine - Magnotta - Cab Sauv
856.94
Towel Multifold
835.53
Cheese - Brick With Pepper
905.39
Madeira
182.4
Lambcasing
240.84
Cheese - Goat With Herbs
971.12
Wine - Beringer Founders Estate
389.82
Ecolab Crystal Fusion
215.45
Ice Cream - Chocolate
588.69
Straws - Cocktale
260.52
Energy - Boo - Koo
100.55
Pork - Belly Fresh
826.12
Caviar - Salmon
154.48
Silicone Parch. 16.3x24.3
812.15
Beef - Ground Lean Fresh
430.55
Truffle Cups Green
579.82
Huck White Towels
874.34
Tortillas - Flour, 10
987.28
Capicola - Hot
581.51
Cucumber - English
699.49
Asparagus - Frozen
0.02
Flour - Semolina
121.01
Curry Powder
234.64
Beef - Tenderloin Tails
807.71
Sweet Pea Sprouts
808.7
Table Cloth 91x91 Colour
295.88
Foam Espresso Cup Plain White
15.9
Pork - Caul Fat
844.54
Pepper - Chili Powder
992.49
Coffee - Egg Nog Capuccino
127.62
Cookies - Assorted
100.08
Turkey - Breast, Double
812.62
Scallops - 20/30
648.73
Guava
571.96
Bagel - Everything
770.41
V8 - Vegetable Cocktail
209.2
Wine - Coteaux Du Tricastin Ac
203.28
Wine - Pinot Noir Stoneleigh
960.39
Ecolab - Ster Bac
351.76
Toothpick Frilled
706.48
Sugar - Sweet N Low, Individual
392.74
Bacardi Limon
661.21
Pork - European Side Bacon
215.97
Sobe - Berry Energy
582.38
Lobster - Tail, 3 - 4 Oz
149.96
Caviar - Salmon
550.63
Cheese - Cambozola
128.19
Jam - Raspberry,jar
945.52
Cake - Dulce De Leche
910.62
Tilapia - Fillets
618.72
Sesame Seed Black
745.11
Beer - True North Lager
784.84
Chick Peas - Canned
580.03
Clam - Cherrystone
339.29
Ham Black Forest
545.62
Ecolab - Balanced Fusion
537.94
Juice - Grapefruit, 341 Ml
527.4
Bread - Multigrain, Loaf
547.64
Almonds Ground Blanched
38.36
Water - Evian 355 Ml
383.42
Skewers - Bamboo
922.51
Potatoes - Idaho 80 Count
767.63
Wine - Lamancha Do Crianza
401.94
Pate Pans Yellow
831.68
Cranberries - Fresh
731.86
Plaintain
907.9
Wine - Touraine Azay - Le - Rideau
930.24
Nut - Hazelnut, Whole
566.39
Cheese - Montery Jack
390.28
Ocean Spray - Kiwi Strawberry
785.94
Loaf Pan - 2 Lb, Foil
73.81
Bread Base - Goodhearth
417.03
Buffalo - Short Rib Fresh
423.02
Corn - Mini
628.83
Longos - Chicken Curried
109.76
Wine - Winzer Krems Gruner
836.77
Flour Dark Rye
756.05
Pastry - Cheese Baked Scones
163.93
Water - Tonic
216.76
Hinge W Undercut
945.62
Versatainer Nc - 9388
346.79
Dc - Frozen Momji
628.06
Whmis - Spray Bottle Trigger
786.67
Chicken - Base, Ultimate
596.42
Sausage - Meat
45.82
Radish
57.46
Cheese - Pied De Vents
215.03
Strawberries
468.06
Rum - Spiced, Captain Morgan
321.51
Soup - Campbells Mac N Cheese
286.28
Wild Boar - Tenderloin
742.33
Wine - Beaujolais Villages
691.79
Wine - Magnotta - Bel Paese White
247.31
Truffle Cups - Brown
154.44
Bread - Italian Corn Meal Poly
270.07
Coffee - Egg Nog Capuccino
435.68
Scallops - 20/30
214.51
Pomegranates
372.37
Tomatillo
719.49
Mop Head - Cotton, 24 Oz
37.54
Cranberries - Frozen
668.06
Turkey Tenderloin Frozen
924.03
Beef - Outside, Round
154.59
Sugar Thermometer
113.31
Ginger - Pickled
974.45
Cheese - Manchego, Spanish
156.02
Flour - Bread
623.69
Lamb - Loin, Trimmed, Boneless
802.21
Table Cloth 62x114 White
206.24
Egg Patty Fried
118.31
Spic And Span All Purpose
850.48
Appetizer - Sausage Rolls
511.94
Tomato - Green
884.79
Lychee
505.43
Flour - So Mix Cake White
281.54
Crab - Back Fin Meat, Canned
209.42
Seedlings - Clamshell
989.82
Vinegar - Raspberry
278.05
Gelatine Leaves - Bulk
657.45
Tarts Assorted
645.23
Beef - Prime Rib Aaa
589.62
Beer - Sleemans Cream Ale
503.3
Chicken - Whole Fryers
769.87
Soup - Campbells Chili
726.95
Drambuie
21.36
Wine - Wyndham Estate Bin 777
575.51
Cookie Dough - Oatmeal Rasin
855.26
Iced Tea - Lemon, 340ml
54.08
Wine - Red, Mouton Cadet
132.08
Olives - Green, Pitted
247.71
Bread Roll Foccacia
981.18
Lumpfish Black
967.72
Wine - Bouchard La Vignee Pinot
414.29
Banana Turning
429.63
Soup - Campbells Chicken
340.73
Cucumber - English
547.7
Artichoke - Bottom, Canned
653.13
Rice - Wild
636.83
Bread - Crumbs, Bulk
613.8
Lobster - Tail 6 Oz
98.37
Island Oasis - Lemonade
419.67
Cookies Oatmeal Raisin
623.33
Bread - Burger
250.03
Beans - Soya Bean
74.88
Pork - Kidney
792.16
Coffee - Beans, Whole
657.82
Rootbeer
858.18
Cake - Bande Of Fruit
175.65
Rice - Aborio
197.82
Green Tea Refresher
719.72
Pork - Loin, Boneless
413.97
Cheese - Bakers Cream Cheese
972.36
Urban Zen Drinks
711.96
Sping Loaded Cup Dispenser
863.47
French Pastry - Mini Chocolate
366.92
Island Oasis - Lemonade
817.79
Longos - Assorted Sandwich
299.99
Wine - Beaujolais Villages
259.85
Lemons
666.92
Ham - Cooked
696.05
Chocolate - Pistoles, Lactee, Milk
401.22
Dill Weed - Dry
405.1
Cheese - Cheddar, Old White
460.74
Iced Tea - Lemon, 340ml
388.36
Vol Au Vents
154.16
Crackers - Graham
373.98
Worcestershire Sauce
340.45
Pastry - Plain Baked Croissant
529.07
Sugar - Cubes
962.64
Pepperoni Slices
563.73
Lobster - Cooked
802.2
Soy Protein
314.26
V8 - Vegetable Cocktail
668
Cheese - Manchego, Spanish
109.53
Pork - Loin, Center Cut
748.52
Tea - Herbal Orange Spice
30.3
Wine - Red, Cabernet Merlot
307.71
Rolled Oats
585.39
Truffle Cups - White Paper
121.33
Beets
782.08
Bread - Multigrain Oval
211.29
Pepper - White, Whole
928.67
Sachet
788.32
Milk - Condensed
52.22
Dried Apple
643.12
Soup - French Can Pea
756.55
Wine - Lamancha Do Crianza
757.87
Cheese - Brick With Onion
245.61
Muffin Mix - Carrot
113.89
Pasta - Angel Hair
314.97
Chicken - Leg, Fresh
366.68
Bagels Poppyseed
52.46
Juice - V8 Splash
928.21
Schnappes - Peach, Walkers
74.67
Tart - Pecan Butter Squares
142.16
Beer - Creemore
97.83
Pepper - Cubanelle
233.78
V8 - Vegetable Cocktail
281.47
Pie Pecan
2.17
Tea Peppermint
788.2
Wine - White, Pinot Grigio
587.66
Water - Mineral, Carbonated
266.49
Fudge - Cream Fudge
700.54
Tea - English Breakfast
140.99
Pasta - Tortellini, Fresh
928.48
Tumeric
939.28
Knife Plastic - White
862.96
Vinegar - Sherry
474.41
Pork - Sausage Casing
68.46
Squid - U - 10 Thailand
200.31
Gherkin
907.47
Salt - Celery
574.31
Blueberries
729.36
Jello - Assorted
211.05
Water - Perrier
152.45
Arizona - Green Tea
846.37
Sprouts - Brussel
416.2
Sauce - Fish 25 Ozf Bottle
988.15
Wine - Cava Aria Estate Brut
787.41
Mousse - Passion Fruit
830.79
Table Cloth - 53x69 Colour
497.67
Beef - Top Sirloin - Aaa
525.69
Cherries - Fresh
800.54
Lotus Rootlets - Canned
601.51
Bread - French Baquette
246.81
Wine - White, Lindemans Bin 95
201.83
Soup - Knorr, Classic Can. Chili
940.42
Juice - Cranberry, 341 Ml
580.53
Beans - Navy, Dry
75.22
Tarragon - Fresh
790
Soup - French Onion, Dry
806.32
Wine - Sauvignon Blanc
888.13
Latex Rubber Gloves Size 9
575.22
Bread - Sour Sticks With Onion
213.41
Chocolate Bar - Coffee Crisp
373.97
Juice - Lime
37.92
Cognac - Courvaisier
66.52
Cookies - Englishbay Wht
328.5
Muffin - Carrot Individual Wrap
202.46
Pepper - Chipotle, Canned
974.54
Graham Cracker Mix
743.37
Peach - Halves
831.52
Leeks - Baby, White
30.01
Beef Wellington
614.45
Carbonated Water - White Grape
543.98
Appetizer - Sausage Rolls
510.82
Sauce Tomato Pouch
483.06
Chinese Foods - Pepper Beef
806.31
Blackberries
772.65
Wine - Sake
793.54
Soup - Knorr, Chicken Gumbo
971.8
Onions - Red
318.97
Yokaline
763.55
Muffin Mix - Lemon Cranberry
915.19
Wine - Magnotta, Merlot Sr Vqa
905.58
Sprouts - Pea
804.65
Tea - Apple Green Tea
856.84
Seabream Whole Farmed
551.81
Sugar - Sweet N Low, Individual
23.59
Tomatoes - Diced, Canned
991.34
Tart Shells - Sweet, 4
839.63
Ginger - Ground
394.8
Pepsi - 600ml
369.54
Catfish - Fillets
847.57
Yogurt - Cherry, 175 Gr
564.84
Soup - Campbells, Creamy
577.13
Cabbage - Red
282.38
Pasta - Ravioli
905.58
Chivas Regal - 12 Year Old
647.24
Appetizer - Cheese Bites
429.11
Lotus Rootlets - Canned
186.87
Bread - Onion Focaccia
515.49
Onions - Vidalia
37.28
Appetizer - Tarragon Chicken
126.11
Cinnamon - Ground
176.37
Chocolate - Milk
651.81
Chicken - Base
558.35
Cookies - Fortune
260.35
Plate - Foam, Bread And Butter
423.21
Quail - Whole, Boneless
574.99
Bagels Poppyseed
307.97
Crab - Imitation Flakes
717.33
Shortbread - Cookie Crumbs
55
Lettuce - Lolla Rosa
283.73
Sour Puss - Tangerine
603.7
Bacon Strip Precooked
146.77
Lamb - Bones
308.36
Beef Dry Aged Tenderloin Aaa
775.08
Potatoes - Idaho 80 Count
714.48
Ocean Spray - Kiwi Strawberry
319.99
Capon - Breast, Wing On
546.87
Huck Towels White
964.3
Wine - Bouchard La Vignee Pinot
451.06
Quail Eggs - Canned
765.11
Tomato - Green
978.68
Soup - Campbells Chili
524.6
Parsley Italian - Fresh
642.67
Parsnip
523.81
Cheese Cloth No 60
35.34
Apricots - Halves
819.06
Toamtoes 6x7 Select
397.06
Energy Drink Red Bull
317.99
Oil - Pumpkinseed
4.56
Halibut - Whole, Fresh
601.59
Island Oasis - Sweet And Sour Mix
831.2
Celery Root
521.5
Spinach - Packaged
876.34
Water - Spring Water, 355 Ml
494.09
Pasta - Linguini, Dry
268.55
Chicken - Diced, Cooked
544.81
Walkers Special Old Whiskey
11.06
Thyme - Lemon, Fresh
580.64
Garbage Bags - Clear
286.91
Bread - Roll, Whole Wheat
377.84
Beef - Prime Rib Aaa
596.99
Glycerine
293.07
Chips - Potato Jalapeno
212.43
Lettuce - Curly Endive
880.18
Wine - Valpolicella Masi
838.9
Asparagus - White, Canned
699.43
Bandage - Flexible Neon
152.33
Wine La Vielle Ferme Cote Du
685.13
Champagne - Brights, Dry
237.13
Flour - Cake
876.08
Lamb - Sausage Casings
777.89
Wine - Wyndham Estate Bin 777
945.04
Cocktail Napkin Blue
472.67
Trueblue - Blueberry 12x473ml
397.85
Pork - Bacon, Double Smoked
542.09
Ecolab - Hobart Upr Prewash Arm
785.08
Chicken - Soup Base
475.62
Squid U5 - Thailand
15.04
Beets
867.69
Nut - Pumpkin Seeds
146.37
Cotton Wet Mop 16 Oz
775.65
Tomato Paste
367.39
Chicken - White Meat With Tender
459.79
Cup - 3.5oz, Foam
471.27
Wine - Red, Mouton Cadet
507.24
Fudge - Chocolate Fudge
909.57
Onions - Green
233.44
Cheese - Brick With Onion
998.07
Wine - Balbach Riverside
576.64
Radish - Black, Winter, Organic
219.72
Ginger - Crystalized
599.16
Turnip - White, Organic
116.69
Beef - Tender Tips
557.06
Petit Baguette
876.85
Chips Potato All Dressed - 43g
664.68
Mcguinness - Blue Curacao
983.49
Muffin Chocolate Individual Wrap
492.72
Bread Cranberry Foccacia
240.19
Chinese Foods - Chicken Wing
700.06
Coffee Cup 12oz 5342cd
57.91
Jack Daniels
219.15
Nori Sea Weed
549.44
Gelatine Leaves - Bulk
162.1
Chicken - Leg / Back Attach
743
Savory
549.73
Beef Dry Aged Tenderloin Aaa
75.58
Slt - Individual Portions
266.15
Kohlrabi
162.96
Wine - Malbec Trapiche Reserve
701.22
Crab - Imitation Flakes
978.11
Sterno - Chafing Dish Fuel
279.63
Carbonated Water - Blackcherry
0.43
Tomato - Tricolor Cherry
95.51
Chilli Paste, Hot Sambal Oelek
801.92
Beans - Fava Fresh
62.01
Vinegar - Champagne
536.75
Worcestershire Sauce
16.56
Salt - Celery
867.08
Cod - Fillets
224.85
Lettuce - Sea / Sea Asparagus
213.99
Ice Cream Bar - Rolo Cone
959.07
Salt - Kosher
389.6
Beef - Bresaola
136.34
Eggwhite Frozen
990.65
Nutmeg - Ground
66.88
Red Currant Jelly
296.99
Macaroons - Two Bite Choc
285.7
Crackers Cheez It
424.94
Sugar - Icing
866.03
Cheese - Ermite Bleu
866.27
Apple - Delicious, Golden
639.59
Aspic - Clear
160.85
Beef - Ground Lean Fresh
670.56
Lidsoupcont Rp12dn
200.7
Okra
631.91
Bacardi Breezer - Strawberry
476.43
Table Cloth 120 Round White
155.91
Dried Cranberries
601.4
Tea - Decaf Lipton
731.23
Molasses - Fancy
262.04
Bagel - Sesame Seed Presliced
253.85
Chilli Paste, Ginger Garlic
462.02
Isomalt
70.84
Loquat
543.91
Soup - Knorr, Chicken Gumbo
607.52
Beef - Tenderloin
867.04
Salad Dressing
984.55
Langers - Cranberry Cocktail
38.12
Chocolate - Unsweetened
155.7
Bread - Assorted Rolls
841.39
Pomegranates
849.6
Cheese - Cheddar, Old White
673.03
External Supplier
378.68
Lamb - Whole Head Off,nz
211.3
Butter - Unsalted
580.67
Basil - Fresh
762.46
Sauce Tomato Pouch
38.91
Steampan - Half Size Shallow
434.29
General Purpose Trigger
881.64
C - Plus, Orange
787.25
Mudslide
244.73
Wine - Alsace Gewurztraminer
895.28
Olives - Morracan Dired
130.87
Cheese - Colby
715.87
Nantucket Apple Juice
996.17
V8 Splash Strawberry Kiwi
680.71
Flour - Strong
566.57
Pepper - Green, Chili
904.2
Wine - Muscadet Sur Lie
216.86
Cabbage - Red
455.61
Water - Mineral, Carbonated
726.8
Pork - Chop, Frenched
766.87
Grouper - Fresh
974.41
Soy Protein
954.09
Coffee - Cafe Moreno
944.71
Mushroom - White Button
375.27
Beer - Blue
247.73
Wine - Mas Chicet Rose, Vintage
142.82
Chocolate - White
738.97
Cabbage - Nappa
950.42
Wine - Placido Pinot Grigo
397.93
Steam Pan - Half Size Deep
363.02
Wine - Niagara Peninsula Vqa
183.86
Pepper - Green, Chili
283.04
Pastry - Chocolate Chip Muffin
623.64
Beef - Tongue, Cooked
355.69
Mix - Cappucino Cocktail
501.08
Coffee - Dark Roast
316.01
Noodles - Steamed Chow Mein
698.84
Cheese - Havarti, Salsa
662.71
Snapple Lemon Tea
942.56
Canadian Emmenthal
855.88
Beans - Fava, Canned
494.52
Muffin - Mix - Bran And Maple 15l
694.95
Curry Powder
180.21
Soup - Canadian Pea, Dry Mix
642.56
Everfresh Products
984.23
Puree - Mocha
262.35
Kirsch - Schloss
740.4
Puree - Raspberry
955.07
Mix Pina Colada
133.07
Yogurt - Raspberry, 175 Gr
328.24
Pastry - Carrot Muffin - Mini
502.04
Beef - Tongue, Cooked
946.28
Wine - Periguita Fonseca
70.65
Urban Zen Drinks
357.39
Yogurt - Cherry, 175 Gr
72.71
Veal - Brisket, Provimi,bnls
732.22
Longos - Grilled Veg Sandwiches
212.78
Cream Of Tartar
386.55
Bar - Granola Trail Mix Fruit Nut
138.05
Foie Gras
21.97
Beef - Top Butt
120.56
Food Colouring - Green
951.53
Beer - Creemore
726.17
Appetizer - Crab And Brie
198.11
Beef - Ox Tongue
109.36
Chutney Sauce
812.27
Veal - Striploin
133.27
Pepper - Paprika, Hungarian
11.04
Pastry - Chocolate Marble Tea
945.86
Beans - Black Bean, Preserved
246.13
Pasta - Penne Primavera, Single
393.51
Wine - White, Cooking
449.38
Cookie - Oreo 100x2
594.86
Cookie Dough - Oatmeal Rasin
955.22
Monkfish - Fresh
930.09
Nantucket - Pomegranate Pear
879.92
Anisette - Mcguiness
696.03
Frangelico
992.04
Temperature Recording Station
194.18
Calaloo
543.56
Wheat - Soft Kernal Of Wheat
108.83
Kirsch - Schloss
595.36
Yogurt - Plain
685.27
Cookies - Amaretto
313.52
Appetizer - Smoked Salmon / Dill
352.5
Squash - Butternut
642.77
Table Cloth 54x54 Colour
493.79
Beef - Bresaola
558.29
Wine - White, Antinore Orvieto
590.31
Pasta - Agnolotti - Butternut
81.73
Glass Clear 7 Oz Xl
149.23
Pork - Butt, Boneless
529.63
Flour - Whole Wheat
369.92
Soup - Tomato Mush. Florentine
701.62
Soup - Knorr, Veg / Beef
316.3
Veal - Brisket, Provimi,bnls
152.08
Wine - Lamancha Do Crianza
322.27
Cake - Night And Day Choclate
350.56
Pepper - Red Bell
880.02
Appetizer - Mini Egg Roll, Shrimp
8.78
Basil - Dry, Rubbed
888.01
Lentils - Green Le Puy
245.41
Tortillas - Flour, 12
608.14
Wine - Tio Pepe Sherry Fino
770.11
Syrup - Golden, Lyles
109.35
Vermouth - Sweet, Cinzano
653.91
Pasta - Tortellini, Fresh
941.24
Muffin - Carrot Individual Wrap
790.98
Black Currants
27.15
Milk - 1%
903.74
Truffle - Whole Black Peeled
68.82
Rice Paper
159.81
Soup - Campbells, Minestrone
172.42
Scotch - Queen Anne
560.89
Roe - Lump Fish, Red
512.25
Roe - Lump Fish, Red
999.28
Pineapple - Golden
360.17
Croissants Thaw And Serve
989.72
Juice - Orangina
661.08
Wine - Taylors Reserve
274.91
Garlic Powder
15.16
Cleaner - Bleach
233.96
Pastry - Key Limepoppy Seed Tea
162.09
Pepper - Black, Crushed
724.72
Chicken Giblets
555.93
Onion - Dried
142.1
Cardamon Ground
722.11
Sprouts - Baby Pea Tendrils
195.11
Crawfish
678.68
Chips Potato Swt Chilli Sour
737.66
Muffin Hinge 117n
857.29
Lobster - Cooked
615.95
Nut - Hazelnut, Whole
820.82
Spic And Span All Purpose
958
Oil - Sunflower
849.41
Duck - Whole
589.74
Lid - 3oz Med Rec
641
Pasta - Fett Alfredo, Single Serve
936.95
Soup - Campbells, Spinach Crm
380.6
Shrimp - Tiger 21/25
437.69
Icecream Cone - Areo Chocolate
371.22
Bread - Bagels, Plain
92.28
Loaf Pan - 2 Lb, Foil
483.47
Mackerel Whole Fresh
363.37
Soup - Campbells - Tomato
704.4
Pastry - Banana Muffin - Mini
351.23
Sausage - Breakfast
965.58
Huck White Towels
261.02
Wine - Valpolicella Masi
769.81
Oil - Cooking Spray
233.15
Soup - Campbells, Beef Barley
989.17
Wine - Montecillo Rioja Crianza
274.03
Goldschalger
536.74
Napkin - Beverage 1 Ply
463.16
Soup Campbells Split Pea And Ham
453.64
Wine - Guy Sage Touraine
856.97
Ecolab Silver Fusion
328.07
Hersey Shakes
239.4
Scampi Tail
703.99
Pork - Inside
142.04
Couscous
201.07
Sauce Bbq Smokey
668.85
Soup - Campbells Mushroom
382.75
Beer - Mcauslan Apricot
572.99
Extract - Vanilla,artificial
316.99
Lid - 16 Oz And 32 Oz
81.59
Trout - Rainbow, Frozen
906.67
Bacardi Raspberry
267.74
Turkey - Breast, Smoked
410.77
Madeira
507.42
Juice - Apple 284ml
68.85
Crab - Meat
858.93
Cloves - Ground
842.9
Bar Mix - Pina Colada, 355 Ml
692.28
Beer - Fruli
705.78
Marsala - Sperone, Fine, D.o.c.
545.21
Wonton Wrappers
174.02
Salt And Pepper Mix - Black
78.9
Chef Hat 25cm
774.51
Onions Granulated
766.24
Tart Shells - Savory, 4
772.42
Wine - Montecillo Rioja Crianza
280.64
Salmon - Sockeye Raw
873.35
Pepper - Gypsy Pepper
466.2
Yucca
614.95
Lobster - Cooked
71.68
Quiche Assorted
555.21
Wine - Magnotta - Belpaese
918.17
Sausage - Liver
384.12
Cheese - La Sauvagine
543.44
Appetizer - Southwestern
221.29
Rum - Cream, Amarula
228.14
Juice - Orange
460.71
Coffee Cup 12oz 5342cd
146.51
Sprouts Dikon
460.89
Beef - Striploin
635.34
Sobe - Green Tea
638.25
Pasta - Fusili, Dry
990.93
Milk - Buttermilk
38.22
Wine - Wyndham Estate Bin 777
745.72
<script lang="ts">
	import type { BaseColumn } from '$lib/datagrid/types';
	import type { InventoryDataRow as Row } from '$lib/data/inventory';
	import { setContext } from 'svelte';
	import { TzezarDatagrid } from '$lib/datagrid/tzezar-datagrid.svelte';
	import { inventoryData as data } from '$lib/data/inventory';
	import * as Datagrid from '$lib/datagrid';
	export const columns = [
		{
			id: 'product.name',
			title: 'Product name',
            grow: true
		},
		{
			id: 'price',
			title: 'Price'
		}
	] satisfies BaseColumn<Row>[];

	let datagrid = setContext(
		`datagrid`,
		new TzezarDatagrid({
			data,
			columns
		})
	);
</script>

<Datagrid.Datagrid>
	{#snippet head()}
		{#each datagrid.columns as column (column.id)}
			<Datagrid.Header {column} />
		{/each}
	{/snippet}
	{#snippet body()}
		{#each datagrid.data as row, rowIndex}
			<Datagrid.Row {rowIndex}>
				{#each datagrid.columns as column, columnIndex}
					<Datagrid.Cell {columnIndex} {rowIndex} {column} {row} />
				{/each}
			</Datagrid.Row>
		{/each}
	{/snippet}
</Datagrid.Datagrid>