View laravel-hotwire on GitHub
1M
v0.91.0
Search 71 components and 72 controllers by name, category or description.
Table
Responsive semantic table primitives for headers, bodies, footers, captions, rows and cells
Basic table
| Invoice | Customer | Status | Amount |
|---|---|---|---|
| INV001 | Ada Lovelace | Paid | $250.00 |
| INV002 | Grace Hopper | Pending | $150.00 |
| INV003 | Alan Turing | Unpaid | $350.00 |
| INV004 | Dennis Ritchie | Paid | $450.00 |
| INV005 | Barbara Liskov | Paid | $550.00 |
| Total | $1,750.00 | ||
<hw:table>
<hw:table.caption>Recent invoices from the last quarter.</hw:table.caption>
<hw:table.header>
<hw:table.row>
<hw:table.head>Invoice</hw:table.head>
<hw:table.head>Customer</hw:table.head>
<hw:table.head>Status</hw:table.head>
<hw:table.head class="text-right">Amount</hw:table.head>
</hw:table.row>
</hw:table.header>
<hw:table.body>
@foreach ($invoices as $invoice)
<hw:table.row>
<hw:table.cell class="font-medium">{{ $invoice['id'] }}</hw:table.cell>
<hw:table.cell>{{ $invoice['customer'] }}</hw:table.cell>
<hw:table.cell>
<hw:badge :variant="match($invoice['status']) {
'Paid' => 'secondary',
'Pending' => 'outline',
'Unpaid' => 'destructive',
default => 'default',
}">
{{ $invoice['status'] }}
</hw:badge>
</hw:table.cell>
<hw:table.cell class="text-right">{{ $invoice['amount'] }}</hw:table.cell>
</hw:table.row>
@endforeach
</hw:table.body>
<hw:table.footer>
<hw:table.row>
<hw:table.cell colspan="3">Total</hw:table.cell>
<hw:table.cell class="text-right">{{ $invoiceTotal }}</hw:table.cell>
</hw:table.row>
</hw:table.footer>
</hw:table>