Hover reveal
Actions that show up when you point at their row or card, so busy screens stay calm and the buttons are right there when you need them. Pure CSS.
Table rows
Add .reveal to the actions. Table rows are groups already; for anything else add .reveal-group to the thing you point at.
| Order | Customer | Total | Actions |
|---|---|---|---|
| #10421 | Ana Kim | $129.00 | |
| #10420 | Marco Rossi | $48.50 |
<div class="table-wrap">
<table class="table table-hover">
<thead><tr><th>Order</th><th>Customer</th><th class="text-end">Total</th><th><span class="visually-hidden">Actions</span></th></tr></thead>
<tbody>
<tr><td>#10421</td><td>Ana Kim</td><td class="text-end">$129.00</td><td class="text-end"><span class="reveal inline-flex gap-1"><button class="btn btn-icon btn-sm btn-ghost" type="button" aria-label="Edit order 10421"><i class="mi mi-pencil"></i></button><button class="btn btn-icon btn-sm btn-ghost" type="button" aria-label="Delete order 10421"><i class="mi mi-trash"></i></button></span></td></tr>
<tr><td>#10420</td><td>Marco Rossi</td><td class="text-end">$48.50</td><td class="text-end"><span class="reveal inline-flex gap-1"><button class="btn btn-icon btn-sm btn-ghost" type="button" aria-label="Edit order 10420"><i class="mi mi-pencil"></i></button><button class="btn btn-icon btn-sm btn-ghost" type="button" aria-label="Delete order 10420"><i class="mi mi-trash"></i></button></span></td></tr>
</tbody>
</table>
</div>Swap a value for actions
.reveal-swap holds two things in one spot: .reveal-off shows normally (a time, a count) and the .reveal takes its place on hover. .reveal-slide slides in as it appears.
- Design review10:30
- Weekly planning14:00
<ul class="divide-y divide-soft box p-0 max-w-md">
<li class="reveal-group hstack px-4 py-3"><b>Design review</b><span class="spacer"></span><span class="reveal-swap"><span class="reveal-off text-sm text-muted">10:30</span><span class="reveal reveal-slide inline-flex gap-1"><button class="btn btn-sm" type="button">Join</button></span></span></li>
<li class="reveal-group hstack px-4 py-3"><b>Weekly planning</b><span class="spacer"></span><span class="reveal-swap"><span class="reveal-off text-sm text-muted">14:00</span><span class="reveal reveal-slide inline-flex gap-1"><button class="btn btn-sm" type="button">Join</button></span></span></li>
</ul>When they show
- Pointing at the group, keyboard focus anywhere inside it, a picked row (a ticked checkbox,
aria-selected,.is-selected), or a menu opened from it. - On touch screens they always show (there is no hover).
.is-shownon a.revealkeeps it visible.
The space is kept, so nothing jumps when the actions appear. Every action still needs its own name (aria-label) for screen readers.