Helpers
Hover reveal
Actions that appear when you point at their row, card or list item — so busy admin screens stay calm, and the buttons are right there when you need them. Pure CSS.
| Order | Customer | Status | Total | Actions | |
|---|---|---|---|---|---|
| #10421 | Ana Kim | Paid | $129.00 | ||
| #10420 | Marco Rossi | Pending | $48.50 | ||
| #10419 | Lee Tran | Refunded | $212.99 | ||
| #10418 | Sofia Rossi | Paid | $76.00 |
<tr>
<td>#10421</td> …
<td class="reveal">
<button class="btn btn-ghost btn-icon btn-sm" aria-label="Edit order 10421">
<i class="mi mi-pencil"></i>
</button>
<div class="dropdown">…</div>
</td>
</tr>
- Table rows,
.list-group-items and.mediaare groups already. Anything else: add.reveal-group. - The actions stay visible while the row has keyboard focus, is selected (its checkbox ticked,
.active,aria-selected) or has a menu open — try the ⋯ button. - On touch screens, which can't hover, they're simply always shown. The space is kept, so nothing jumps when they appear.
Swap a value for actions
.reveal-swap puts two things in one spot: the .reveal-off part shows normally, the .reveal part on hover — like an inbox where the time turns into buttons.
- AKAna KimWhere is my order #10421?
- MRMarco RossiWholesale prices for 200 mugs
- LTLee TranRefund for the chipped plate
<li class="list-group-item">
…
<div class="reveal-swap">
<span class="reveal-off">9:41</span>
<span class="reveal">
<button …>Archive</button>
<button …>Snooze</button>
</span>
</div>
</li>
Cards and tiles
Add .reveal-group to any container. .reveal-slide slides the actions in as well.
Invoice-10421.pdf
84 KB
Mug-photo.jpg
1.2 MB
Stock-November.csv
12 KB
<div class="card reveal-group">
…
<div class="reveal reveal-slide"><button …>Download</button></div>
</div>
| Class | What it does |
|---|---|
.reveal | Hidden until its group is hovered, focused, selected or has a menu open |
.reveal-group | Makes an element a group (tr, .list-group-item, .media already are) |
.reveal-slide | Slides in as it appears |
.reveal-swap > .reveal-off + .reveal | Two things in one spot, swapped on hover |
.reveal.is-shown | Force it visible (e.g. while something is loading) |