<?phpuse Livewire\Attributes\Computed;use Livewire\Component;new class extends Component { #[Computed] public function stats(): array { return [ ['label' => 'Average price', 'value' => '$44.14'], ['label' => 'Inventory value', 'value' => '$166,106'], ['label' => 'Sell-through rate', 'value' => '76%', 'badge' => 'Good', 'color' => 'green'], ['label' => 'Units in stock', 'value' => '3,517', 'badge' => '7 SKUs', 'color' => 'zinc'], ['label' => 'Low-stock items', 'value' => '3', 'badge' => '2 critical', 'color' => 'red'], ]; } #[Computed] public function products(): array { return [ ['image' => 'luma-desk-lamp', 'name' => 'Luma Desk Lamp', 'status' => 'Active', 'status_color' => 'green', 'inventory' => '1,150', 'price' => '$89.99', 'type' => 'Lighting', 'supplier' => 'Northline Goods'], ['image' => 'stone-thermal-mug', 'name' => 'Stone Thermal Mug', 'status' => 'Active', 'status_color' => 'green', 'inventory' => '2,278', 'price' => '$26.00', 'type' => 'Drinkware', 'supplier' => 'Harbor Supply Co.'], ['image' => 'aero-room-diffuser', 'name' => 'Aero Room Diffuser', 'status' => 'Draft', 'status_color' => 'blue', 'inventory' => '55', 'price' => '$39.00', 'type' => 'Home fragrance', 'supplier' => 'Vale Studio'], ['image' => 'fold-cable-pouch', 'name' => 'Fold Cable Pouch', 'status' => 'Archived', 'status_color' => 'zinc', 'inventory' => '0', 'price' => '$22.00', 'type' => 'Tech accessory', 'supplier' => 'Parcel & Form'], ['image' => 'cloud-desk-mat', 'name' => 'Cloud Desk Mat', 'status' => 'Active', 'status_color' => 'green', 'inventory' => '23', 'price' => '$34.00', 'type' => 'Desk accessory', 'supplier' => 'Mono Works'], ['image' => 'pebble-charging-dock', 'name' => 'Pebble Charging Dock', 'status' => 'Archived', 'status_color' => 'zinc', 'inventory' => '0', 'price' => '$56.00', 'type' => 'Wireless charger', 'supplier' => 'Current House'], ['image' => 'breeze-mini-fan', 'name' => 'Breeze Mini Fan', 'status' => 'Active', 'status_color' => 'green', 'inventory' => '11', 'price' => '$42.00', 'type' => 'Desk accessory', 'supplier' => 'Daily Objects'], ]; }};?>{{-- This standalone demo keeps its application shell inline. In a production app, move shared navigation into your app layout. --}}<div class="min-h-dvh bg-zinc-50 dark:bg-zinc-950"> <flux:sidebar sticky collapsible="mobile" class="bg-zinc-100 dark:bg-zinc-900"> <flux:sidebar.header> <flux:dropdown class="min-w-0 flex-1"> <flux:sidebar.brand as="button" logo="https://fluxui.dev/img/demos/products/formwell.svg" name="Store Inc." alt="Formwell" icon:trailing="chevron-up-down" class="w-full" /> <flux:menu class="min-w-56"> <flux:menu.radio.group> <flux:menu.radio value="store-inc" checked>Store Inc.</flux:menu.radio> <flux:menu.radio value="outpost">Outpost Supply</flux:menu.radio> </flux:menu.radio.group> <flux:menu.separator /> <flux:menu.item icon="plus">Add store</flux:menu.item> </flux:menu> </flux:dropdown> <flux:sidebar.collapse class="lg:hidden" /> </flux:sidebar.header> <flux:sidebar.nav> <flux:sidebar.item icon="home" href="#" :accent="false">Home</flux:sidebar.item> <flux:sidebar.item icon="inbox" href="#" :accent="false">Orders</flux:sidebar.item> <flux:sidebar.item icon="tag" href="#" :accent="false" current>Products</flux:sidebar.item> <flux:sidebar.item icon="users" href="#" :accent="false">Customers</flux:sidebar.item> <flux:sidebar.item icon="banknotes" href="#" :accent="false">Finances</flux:sidebar.item> <flux:sidebar.item icon="chart-pie" href="#" :accent="false">Analytics</flux:sidebar.item> <flux:sidebar.item icon="receipt-percent" href="#" :accent="false">Discounts</flux:sidebar.item> <flux:sidebar.item icon="calendar" href="#" :accent="false">Content</flux:sidebar.item> </flux:sidebar.nav> <flux:sidebar.nav> <flux:sidebar.group expandable heading="Sales channels"> <flux:sidebar.item icon="globe-alt" href="#" :accent="false">Online store</flux:sidebar.item> <flux:sidebar.item icon="shopping-bag" href="#" :accent="false">Point of sale</flux:sidebar.item> <flux:sidebar.item icon="link" href="#" :accent="false">Socials</flux:sidebar.item> </flux:sidebar.group> </flux:sidebar.nav> <flux:sidebar.nav> <flux:sidebar.group heading="Integrations"> <flux:sidebar.item icon="plus-circle" href="#" :accent="false">Add apps</flux:sidebar.item> </flux:sidebar.group> </flux:sidebar.nav> <flux:sidebar.spacer /> <flux:sidebar.nav> <flux:sidebar.item icon="cog-6-tooth" href="#" :accent="false">Settings</flux:sidebar.item> </flux:sidebar.nav> <flux:separator variant="subtle" /> <flux:dropdown position="top" align="start"> <flux:sidebar.profile avatar="https://fluxui.dev/img/demos/products/olivia-martin.jpg" name="Olivia Martin" circle icon:trailing="arrow-right-start-on-rectangle" /> <flux:menu> <flux:menu.item icon="user">Profile</flux:menu.item> <flux:menu.item icon="arrow-right-start-on-rectangle">Logout</flux:menu.item> </flux:menu> </flux:dropdown> </flux:sidebar> <flux:main class="space-y-6"> <div class="flex items-center gap-2"> <flux:sidebar.toggle class="lg:hidden" icon="bars-2" inset="left" aria-label="Open navigation" /> <flux:breadcrumbs> <flux:breadcrumbs.item href="#" separator="slash">Store Inc.</flux:breadcrumbs.item> <flux:breadcrumbs.item separator="slash">Products</flux:breadcrumbs.item> </flux:breadcrumbs> </div> <div class="flex items-center justify-between gap-4"> <flux:heading size="xl" level="1">Products</flux:heading> <div class="flex items-center gap-2"> <flux:button class="max-md:hidden">Export</flux:button> <flux:button class="max-md:hidden">Import</flux:button> <flux:dropdown align="end"> <flux:button icon:trailing="chevron-down" class="max-sm:hidden">More actions</flux:button> <flux:button icon="ellipsis-horizontal" square aria-label="More actions" class="sm:hidden" /> <flux:menu> <flux:menu.item icon="arrow-up-tray" class="md:hidden">Export</flux:menu.item> <flux:menu.item icon="arrow-down-tray" class="md:hidden">Import</flux:menu.item> <flux:menu.separator class="md:hidden" /> <flux:menu.item icon="squares-plus">Manage collections</flux:menu.item> <flux:menu.item icon="qr-code">Print barcodes</flux:menu.item> <flux:menu.item icon="document-duplicate">Duplicate catalog</flux:menu.item> </flux:menu> </flux:dropdown> <flux:button variant="primary" class="max-sm:hidden">Add product</flux:button> <flux:button variant="primary" icon="plus" square aria-label="Add product" class="sm:hidden" /> </div> </div> <div class="grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5"> @foreach ($this->stats as $stat) <flux:card size="sm"> <flux:text class="truncate">{{ $stat['label'] }}</flux:text> <div class="mt-2 flex items-center gap-2"> <flux:heading size="lg">{{ $stat['value'] }}</flux:heading> @isset ($stat['badge']) <flux:badge size="sm" :color="$stat['color']" rounded>{{ $stat['badge'] }}</flux:badge> @endisset </div> </flux:card> @endforeach </div> <flux:card body="divided"> <flux:card.header> <flux:tabs variant="pills" scrollable scrollable:scrollbar="hide"> <flux:tab name="all" :accent="false" selected>All</flux:tab> <flux:tab name="active" :accent="false">Active</flux:tab> <flux:tab name="draft" :accent="false">Draft</flux:tab> <flux:tab name="archived" :accent="false">Archived</flux:tab> </flux:tabs> <flux:card.actions> <flux:dropdown align="end"> <flux:button size="sm" icon="funnel" icon:variant="outline" square aria-label="Filter by product type" /> <flux:menu keep-open> <flux:menu.heading>Product type</flux:menu.heading> <flux:menu.checkbox>Desk accessory</flux:menu.checkbox> <flux:menu.checkbox>Drinkware</flux:menu.checkbox> <flux:menu.checkbox>Home fragrance</flux:menu.checkbox> <flux:menu.checkbox>Lighting</flux:menu.checkbox> <flux:menu.checkbox>Tech accessory</flux:menu.checkbox> <flux:menu.checkbox>Wireless charger</flux:menu.checkbox> </flux:menu> </flux:dropdown> <flux:dropdown align="end"> <flux:button size="sm" icon="arrows-up-down" icon:variant="outline" square aria-label="Sort products" /> <flux:menu> <flux:menu.heading>Sort by</flux:menu.heading> <flux:menu.radio.group> <flux:menu.radio checked>Product</flux:menu.radio> <flux:menu.radio>Inventory</flux:menu.radio> <flux:menu.radio>Price</flux:menu.radio> </flux:menu.radio.group> <flux:menu.separator /> <flux:menu.radio.group> <flux:menu.radio checked>Ascending</flux:menu.radio> <flux:menu.radio>Descending</flux:menu.radio> </flux:menu.radio.group> </flux:menu> </flux:dropdown> <flux:dropdown align="end"> <flux:button size="sm" icon="ellipsis-horizontal" icon:variant="outline" square aria-label="More options" /> <flux:menu> <flux:menu.item icon="view-columns">Edit columns</flux:menu.item> <flux:menu.item icon="arrow-up-tray">Export view</flux:menu.item> </flux:menu> </flux:dropdown> </flux:card.actions> </flux:card.header> <flux:card.body> <flux:table bleed aria-label="Products"> <flux:table.columns> <flux:table.column><flux:checkbox aria-label="Select all products" /></flux:table.column> <flux:table.column>Product</flux:table.column> <flux:table.column>Status</flux:table.column> <flux:table.column class="max-sm:hidden">Inventory</flux:table.column> <flux:table.column class="max-md:hidden">Price</flux:table.column> <flux:table.column class="max-xl:hidden">Product type</flux:table.column> <flux:table.column class="max-xl:hidden">Supplier</flux:table.column> </flux:table.columns> <flux:table.rows> @foreach ($this->products as $product) <flux:table.row> <flux:table.cell> <flux:checkbox aria-label="Select {{ $product['name'] }}" /> </flux:table.cell> <flux:table.cell variant="strong" class="w-full max-w-0"> <div class="flex items-center gap-3"> <img src="https://fluxui.dev/img/demos/products/{{ $product['image'] }}.jpg" alt="" class="size-10 shrink-0 rounded-lg object-cover"> <span class="truncate">{{ $product['name'] }}</span> </div> </flux:table.cell> <flux:table.cell> <flux:badge size="sm" :color="$product['status_color']" rounded inset="top bottom">{{ $product['status'] }}</flux:badge> </flux:table.cell> <flux:table.cell variant="strong" class="max-sm:hidden"> <div class="flex items-center gap-2"> {{ $product['inventory'] }} @if ($product['inventory'] === '0') <flux:badge size="sm" color="red" rounded inset="top bottom">Out of stock</flux:badge> @endif </div> </flux:table.cell> <flux:table.cell variant="strong" class="max-md:hidden">{{ $product['price'] }}</flux:table.cell> <flux:table.cell class="max-xl:hidden">{{ $product['type'] }}</flux:table.cell> <flux:table.cell class="max-xl:hidden">{{ $product['supplier'] }}</flux:table.cell> </flux:table.row> @endforeach </flux:table.rows> </flux:table> </flux:card.body> </flux:card> </flux:main></div>