Beartropy Logo

Beartropy Tables

Open Source Laravel Package

A powerful, flexible, and fully customizable data table component for Laravel Livewire. Built with a focus on developer experience and UI consistency.

Get Started
composer require beartropy/tables
Show Code
Data Table
+ Select a theme...
#
Name
Hex Code
Color
Google it
Primary
Category
Created at
1
Red #FF0000 ██████████████ Search in google Warm 2026-02-08
2
Green #00FF00 ██████████████ Search in google Cool 2026-02-07
3
Blue #0000FF ██████████████ Search in google Cool 2026-02-06
4
Yellow #FFFF00 ██████████████ Search in google Warm 2026-02-05
5
Purple #800080 ██████████████ Search in google Cool 2026-02-04
6
Orange #FFA500 ██████████████ Search in google Warm 2026-02-03
7
Pink #FFC0CB ██████████████ Search in google Warm 2026-02-02
8
Black #000000 ██████████████ Search in google Neutral 2026-02-01
9
White #FFFFFF ██████████████ Search in google Neutral 2026-01-31
10
Cyan #00FFFF ██████████████ Search in google Cool 2026-01-30
Showing 1 To 10 Of 30 Entries
1<?php
2 
3namespace App\Livewire\Tables;
4 
5use Livewire\Attributes\On;
6use Livewire\Attributes\Layout;
7use Beartropy\Tables\YATBaseTable;
8use Illuminate\Support\Facades\Auth;
9use Beartropy\Tables\Exports\GenericExport;
10use Beartropy\Tables\Classes\Columns\Column;
11use Beartropy\Tables\Classes\Columns\BoolColumn;
12use Beartropy\Tables\Classes\Columns\DateColumn;
13use Beartropy\Tables\Classes\Columns\LinkColumn;
14use Beartropy\Tables\Classes\Filters\FilterBool;
15use Beartropy\Tables\Classes\Filters\FilterString;
16use Beartropy\Tables\Classes\Filters\FilterDateRange;
17use Beartropy\Tables\Classes\Filters\FilterSelectMagic;
18 
19class DemoTable extends YATBaseTable
20{
21 
22 public $tableName = 'DemoTableColors';
23 public string $theme = 'gray';
24 
25 
26 public function settings(): void
27 {
28 $this->hasBulk(true);
29 $this->useStateHandler(false);
30 $this->addButtons([
31 ["label" => 'Delete selected rows', "action" => "remove", "color" => "red"]
32 ]);
33 }
34 public function data()
35 {
36 return collect([
37 ['id' => 1, 'name' => 'Red', 'hex' => '#FF0000', 'is_primary' => true, 'category' => 'Warm', 'created_at' => now()->subDays(1)->format('Y-m-d H:i:s')],
38 ['id' => 2, 'name' => 'Green', 'hex' => '#00FF00', 'is_primary' => true, 'category' => 'Cool', 'created_at' => now()->subDays(2)->format('Y-m-d H:i:s')],
39 ['id' => 3, 'name' => 'Blue', 'hex' => '#0000FF', 'is_primary' => true, 'category' => 'Cool', 'created_at' => now()->subDays(3)->format('Y-m-d H:i:s')],
40 ['id' => 4, 'name' => 'Yellow', 'hex' => '#FFFF00', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(4)->format('Y-m-d H:i:s')],
41 ['id' => 5, 'name' => 'Purple', 'hex' => '#800080', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(5)->format('Y-m-d H:i:s')],
42 ['id' => 6, 'name' => 'Orange', 'hex' => '#FFA500', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(6)->format('Y-m-d H:i:s')],
43 ['id' => 7, 'name' => 'Pink', 'hex' => '#FFC0CB', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(7)->format('Y-m-d H:i:s')],
44 ['id' => 8, 'name' => 'Black', 'hex' => '#000000', 'is_primary' => false, 'category' => 'Neutral', 'created_at' => now()->subDays(8)->format('Y-m-d H:i:s')],
45 ['id' => 9, 'name' => 'White', 'hex' => '#FFFFFF', 'is_primary' => false, 'category' => 'Neutral', 'created_at' => now()->subDays(9)->format('Y-m-d H:i:s')],
46 ['id' => 10, 'name' => 'Cyan', 'hex' => '#00FFFF', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(10)->format('Y-m-d H:i:s')],
47 ['id' => 11, 'name' => 'Magenta', 'hex' => '#FF00FF', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(12)->format('Y-m-d H:i:s')],
48 ['id' => 12, 'name' => 'Lime', 'hex' => '#32CD32', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(14)->format('Y-m-d H:i:s')],
49 ['id' => 13, 'name' => 'Teal', 'hex' => '#008080', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(16)->format('Y-m-d H:i:s')],
50 ['id' => 14, 'name' => 'Brown', 'hex' => '#A52A2A', 'is_primary' => false, 'category' => 'Neutral', 'created_at' => now()->subDays(18)->format('Y-m-d H:i:s')],
51 ['id' => 15, 'name' => 'Gray', 'hex' => '#808080', 'is_primary' => false, 'category' => 'Neutral', 'created_at' => now()->subDays(20)->format('Y-m-d H:i:s')],
52 ['id' => 16, 'name' => 'Navy', 'hex' => '#000080', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(22)->format('Y-m-d H:i:s')],
53 ['id' => 17, 'name' => 'Maroon', 'hex' => '#800000', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(24)->format('Y-m-d H:i:s')],
54 ['id' => 18, 'name' => 'Silver', 'hex' => '#C0C0C0', 'is_primary' => false, 'category' => 'Neutral', 'created_at' => now()->subDays(26)->format('Y-m-d H:i:s')],
55 ['id' => 19, 'name' => 'Gold', 'hex' => '#FFD700', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(28)->format('Y-m-d H:i:s')],
56 ['id' => 20, 'name' => 'Olive', 'hex' => '#808000', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(30)->format('Y-m-d H:i:s')],
57 ['id' => 21, 'name' => 'Turquoise', 'hex' => '#40E0D0', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(35)->format('Y-m-d H:i:s')],
58 ['id' => 22, 'name' => 'Lavender', 'hex' => '#E6E6FA', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(38)->format('Y-m-d H:i:s')],
59 ['id' => 23, 'name' => 'Beige', 'hex' => '#F5F5DC', 'is_primary' => false, 'category' => 'Neutral', 'created_at' => now()->subDays(41)->format('Y-m-d H:i:s')],
60 ['id' => 24, 'name' => 'Indigo', 'hex' => '#4B0082', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(44)->format('Y-m-d H:i:s')],
61 ['id' => 25, 'name' => 'Coral', 'hex' => '#FF7F50', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(47)->format('Y-m-d H:i:s')],
62 ['id' => 26, 'name' => 'Crimson', 'hex' => '#DC143C', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(50)->format('Y-m-d H:i:s')],
63 ['id' => 27, 'name' => 'Sky Blue', 'hex' => '#87CEEB', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(53)->format('Y-m-d H:i:s')],
64 ['id' => 28, 'name' => 'Violet', 'hex' => '#EE82EE', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(56)->format('Y-m-d H:i:s')],
65 ['id' => 29, 'name' => 'Salmon', 'hex' => '#FA8072', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(58)->format('Y-m-d H:i:s')],
66 ['id' => 30, 'name' => 'Slate', 'hex' => '#708090', 'is_primary' => false, 'category' => 'Neutral', 'created_at' => now()->subDays(60)->format('Y-m-d H:i:s')],
67 ]);
68 }
69 
70 public function columns(): array
71 {
72 return [
73 Column::make('Name', 'name')
74 ->styling('text-lg font-bold')
75 ->hideFromSelector(true),
76 
77 Column::make('Hex Code', 'hex')
78 ->collapseOnMobile(true),
79 
80 Column::make('Color')
81 ->customData(function ($row, $value) {
82 return '<span style="color:' . $row['hex'] . '">██████████████</span>';
83 })
84 ->toHtml()
85 ->collapseOnMobile(true),
86 
87 LinkColumn::make('Google it')
88 ->href(function ($row) {
89 return "https://www.google.com/search?q=" . $row['name'];
90 })
91 ->text('Search in google')
92 ->target("_blank")
93 ->collapseOnMobile(true),
94 
95 BoolColumn::make('Primary', 'is_primary')
96 ->collapseOnMobile(true),
97 
98 Column::make('Category', 'category')
99 ->collapseOnMobile(true),
100 
101 DateColumn::make('Created at', 'created_at')
102 ->outputFormat('Y-m-d')
103 ->collapseOnMobile(true),
104 ];
105 }
106 
107 public function filters(): array
108 {
109 return [
110 FilterBool::make('Primary'),
111 FilterString::make('name'),
112 FilterSelectMagic::make('Category'),
113 FilterDateRange::make('Created at', 'created_at')
114 ];
115 }
116 
117 public function options(): array
118 {
119 return [
120 "export_selected" => ["label" => "Export selected rows", "icon" => "☑️"],
121 "export_filtered" => ["label" => "Export filtered rows", "icon" => "🔍"],
122 "export_all" => ["label" => "Export all rows", "icon" => "📗"]
123 ];
124 }
125 
126 public function export_all()
127 {
128 $allData = $this->getAllData();
129 return \Maatwebsite\Excel\Facades\Excel::download(new GenericExport($allData, $strip_tags = true), $this->tableName . '.xlsx');
130 }
131 
132 public function export_filtered()
133 {
134 $filteredData = $this->getAfterFiltersData();
135 return \Maatwebsite\Excel\Facades\Excel::download(new GenericExport($filteredData, $strip_tags = true), $this->tableName . '.xlsx');
136 }
137 
138 public function export_selected()
139 {
140 $selected_rows = $this->getSelectedData();
141 if ($selected_rows) {
142 return \Maatwebsite\Excel\Facades\Excel::download(new GenericExport($selected_rows, $strip_tags = true), $this->tableName . '.xlsx');
143 }
144 }
145 
146 public function remove()
147 {
148 foreach ($this->getSelectedRows() as $id) {
149 $this->removeRowFromTable($id);
150 }
151 }
152 
153 
154 #[On('tableStateSaved')]
155 public function notifyTableStateSavedStatus($status)
156 {
157 if ($status) {
158 // notification('Success");
159 } else {
160 // notification('Error");
161 }
162 }
163}
Show Code
Card View
+ Select a theme...
Red
Hex Code #FF0000
Color ██████████████
Category Warm
Green
Hex Code #00FF00
Color ██████████████
Category Cool
Blue
Hex Code #0000FF
Color ██████████████
Category Cool
Yellow
Hex Code #FFFF00
Color ██████████████
Category Warm
Purple
Hex Code #800080
Color ██████████████
Category Cool
Orange
Hex Code #FFA500
Color ██████████████
Category Warm
Pink
Hex Code #FFC0CB
Color ██████████████
Category Warm
Black
Hex Code #000000
Color ██████████████
Category Neutral
White
Hex Code #FFFFFF
Color ██████████████
Category Neutral
Cyan
Hex Code #00FFFF
Color ██████████████
Category Cool
Showing 1 To 10 Of 30 Entries
1<?php
2 
3namespace App\Livewire\Tables;
4 
5use Livewire\Attributes\On;
6use Livewire\Attributes\Layout;
7use Beartropy\Tables\YATBaseTable;
8use Illuminate\Support\Facades\Auth;
9use Beartropy\Tables\Exports\GenericExport;
10use Beartropy\Tables\Classes\Columns\Column;
11use Beartropy\Tables\Classes\Columns\BoolColumn;
12use Beartropy\Tables\Classes\Columns\LinkColumn;
13use Beartropy\Tables\Classes\Filters\FilterBool;
14use Beartropy\Tables\Classes\Filters\FilterString;
15use Beartropy\Tables\Classes\Filters\FilterDateRange;
16use Beartropy\Tables\Classes\Filters\FilterSelectMagic;
17 
18class DemoTableCards extends YATBaseTable
19{
20 
21 public $tableName = 'DemoTableCards';
22 public string $theme = 'gray';
23 
24 public function settings(): void
25 {
26 $this->hasBulk(true);
27 $this->useCards(true); // Force card view
28 $this->useStateHandler(false);
29 $this->addButtons([
30 ["label" => 'Delete selected rows', "action" => "remove", "color" => "red"]
31 ]);
32 
33 $this->addCardModalButtons([
34 ["label" => 'Edit', "action" => "editRow", "color" => "blue"],
35 ["label" => 'Delete', "action" => "removeRow", "color" => "red"]
36 ]);
37 }
38 
39 public function data()
40 {
41 return collect([
42 ['id' => 1, 'name' => 'Red', 'hex' => '#FF0000', 'is_primary' => true, 'category' => 'Warm', 'created_at' => now()->subDays(1)->format('Y-m-d H:i:s')],
43 ['id' => 2, 'name' => 'Green', 'hex' => '#00FF00', 'is_primary' => true, 'category' => 'Cool', 'created_at' => now()->subDays(2)->format('Y-m-d H:i:s')],
44 ['id' => 3, 'name' => 'Blue', 'hex' => '#0000FF', 'is_primary' => true, 'category' => 'Cool', 'created_at' => now()->subDays(3)->format('Y-m-d H:i:s')],
45 ['id' => 4, 'name' => 'Yellow', 'hex' => '#FFFF00', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(4)->format('Y-m-d H:i:s')],
46 ['id' => 5, 'name' => 'Purple', 'hex' => '#800080', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(5)->format('Y-m-d H:i:s')],
47 ['id' => 6, 'name' => 'Orange', 'hex' => '#FFA500', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(6)->format('Y-m-d H:i:s')],
48 ['id' => 7, 'name' => 'Pink', 'hex' => '#FFC0CB', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(7)->format('Y-m-d H:i:s')],
49 ['id' => 8, 'name' => 'Black', 'hex' => '#000000', 'is_primary' => false, 'category' => 'Neutral', 'created_at' => now()->subDays(8)->format('Y-m-d H:i:s')],
50 ['id' => 9, 'name' => 'White', 'hex' => '#FFFFFF', 'is_primary' => false, 'category' => 'Neutral', 'created_at' => now()->subDays(9)->format('Y-m-d H:i:s')],
51 ['id' => 10, 'name' => 'Cyan', 'hex' => '#00FFFF', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(10)->format('Y-m-d H:i:s')],
52 ['id' => 11, 'name' => 'Magenta', 'hex' => '#FF00FF', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(12)->format('Y-m-d H:i:s')],
53 ['id' => 12, 'name' => 'Lime', 'hex' => '#32CD32', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(14)->format('Y-m-d H:i:s')],
54 ['id' => 13, 'name' => 'Teal', 'hex' => '#008080', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(16)->format('Y-m-d H:i:s')],
55 ['id' => 14, 'name' => 'Brown', 'hex' => '#A52A2A', 'is_primary' => false, 'category' => 'Neutral', 'created_at' => now()->subDays(18)->format('Y-m-d H:i:s')],
56 ['id' => 15, 'name' => 'Gray', 'hex' => '#808080', 'is_primary' => false, 'category' => 'Neutral', 'created_at' => now()->subDays(20)->format('Y-m-d H:i:s')],
57 ['id' => 16, 'name' => 'Navy', 'hex' => '#000080', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(22)->format('Y-m-d H:i:s')],
58 ['id' => 17, 'name' => 'Maroon', 'hex' => '#800000', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(24)->format('Y-m-d H:i:s')],
59 ['id' => 18, 'name' => 'Silver', 'hex' => '#C0C0C0', 'is_primary' => false, 'category' => 'Neutral', 'created_at' => now()->subDays(26)->format('Y-m-d H:i:s')],
60 ['id' => 19, 'name' => 'Gold', 'hex' => '#FFD700', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(28)->format('Y-m-d H:i:s')],
61 ['id' => 20, 'name' => 'Olive', 'hex' => '#808000', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(30)->format('Y-m-d H:i:s')],
62 ['id' => 21, 'name' => 'Turquoise', 'hex' => '#40E0D0', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(35)->format('Y-m-d H:i:s')],
63 ['id' => 22, 'name' => 'Lavender', 'hex' => '#E6E6FA', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(38)->format('Y-m-d H:i:s')],
64 ['id' => 23, 'name' => 'Beige', 'hex' => '#F5F5DC', 'is_primary' => false, 'category' => 'Neutral', 'created_at' => now()->subDays(41)->format('Y-m-d H:i:s')],
65 ['id' => 24, 'name' => 'Indigo', 'hex' => '#4B0082', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(44)->format('Y-m-d H:i:s')],
66 ['id' => 25, 'name' => 'Coral', 'hex' => '#FF7F50', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(47)->format('Y-m-d H:i:s')],
67 ['id' => 26, 'name' => 'Crimson', 'hex' => '#DC143C', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(50)->format('Y-m-d H:i:s')],
68 ['id' => 27, 'name' => 'Sky Blue', 'hex' => '#87CEEB', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(53)->format('Y-m-d H:i:s')],
69 ['id' => 28, 'name' => 'Violet', 'hex' => '#EE82EE', 'is_primary' => false, 'category' => 'Cool', 'created_at' => now()->subDays(56)->format('Y-m-d H:i:s')],
70 ['id' => 29, 'name' => 'Salmon', 'hex' => '#FA8072', 'is_primary' => false, 'category' => 'Warm', 'created_at' => now()->subDays(58)->format('Y-m-d H:i:s')],
71 ['id' => 30, 'name' => 'Slate', 'hex' => '#708090', 'is_primary' => false, 'category' => 'Neutral', 'created_at' => now()->subDays(60)->format('Y-m-d H:i:s')],
72 ]);
73 }
74 
75 public function columns(): array
76 {
77 return [
78 Column::make('Name', 'name')
79 ->styling('text-lg font-bold')
80 ->hideFromSelector(true)
81 ->cardTitle(true), // Use as card title
82 
83 Column::make('Hex Code', 'hex')
84 ->showOnCard(), // Show on card body
85 
86 Column::make('Color', 'color')
87 ->customData(function ($row, $value) {
88 return '<span style="color:' . $row['hex'] . '">██████████████</span>';
89 })
90 ->toHtml()
91 ->showOnCard(), // Show on card body
92 
93 LinkColumn::make('Google it', 'google_it')
94 ->href(function ($row) {
95 return "https://www.google.com/search?q=" . $row['name'];
96 })
97 ->text('Search in google')
98 ->target("_blank"),
99 
100 BoolColumn::make('Primary', 'is_primary'),
101 
102 Column::make('Category', 'category')
103 ->showOnCard(), // Show on card body
104 
105 Column::make('Created at', 'created_at'),
106 ];
107 }
108 
109 public function filters(): array
110 {
111 return [
112 FilterBool::make('Primary'),
113 FilterString::make('name'),
114 FilterSelectMagic::make('Category'),
115 FilterDateRange::make('Created at', 'created_at')
116 ];
117 }
118 
119 public function options(): array
120 {
121 return [
122 "export_selected" => ["label" => "Export selected rows", "icon" => "☑️"],
123 "export_filtered" => ["label" => "Export filtered rows", "icon" => "🔍"],
124 "export_all" => ["label" => "Export all rows", "icon" => "📗"],
125 "sarasa" => ["label" => "sarasa", "icon" => "📗"],
126 ];
127 }
128 
129 public function sarasa()
130 {
131 dd($this->getAllData());
132 }
133 
134 public function export_all()
135 {
136 $allData = $this->getAllData();
137 return \Maatwebsite\Excel\Facades\Excel::download(new GenericExport($allData, $strip_tags = true), $this->tableName . '.xlsx');
138 }
139 
140 public function export_filtered()
141 {
142 $filteredData = $this->getAfterFiltersData();
143 return \Maatwebsite\Excel\Facades\Excel::download(new GenericExport($filteredData, $strip_tags = true), $this->tableName . '.xlsx');
144 }
145 
146 public function export_selected()
147 {
148 $selected_rows = $this->getSelectedData();
149 if ($selected_rows) {
150 return \Maatwebsite\Excel\Facades\Excel::download(new GenericExport($selected_rows, $strip_tags = true), $this->tableName . '.xlsx');
151 }
152 }
153 
154 public function remove()
155 {
156 foreach ($this->getSelectedRows() as $id) {
157 $this->removeRowFromTable($id);
158 }
159 }
160 
161 public function editRow($row)
162 {
163 // Edit logic here
164 }
165 
166 public function removeRow($row)
167 {
168 // Remove logic here
169 $this->removeRowFromTable($row['id']);
170 }
171}

Built for Developers

Fast & Reactive

Built on Livewire 3, offering snappy real-time interactions without writing complex JavaScript.

Themable

Switch between preset themes or customize every aspect of the UI to match your brand identity.

Fluent API

Define columns, filters, and options using a clean, chainable PHP API that developers love.