HoverRevealAction

HoverRevealAction

HkHoverRevealAction keeps a row's secondary actions out of sight until they are wanted: the host content sits in the default slot as it always would, and an extension slot — an inline cluster of icon buttons — slides out beside it when the row is hovered, pressed or focused. At rest nothing of the extension is visible or clickable.

  • A second control that pushes the main control aside inside one button surface is HkSupplementInset; this component overlays its extension on whatever follows the host.
  • Actions that are always visible are plain HkIconButtons.

Import

tsx
1
import { HkHoverRevealAction } from "@celestia-island/hikari";
rust
1
2
use hikari_components::*;          // HoverRevealAction, HoverRevealPlacement, …
use hikari_components::prelude::*; // rsx!, VNode, Icon, MdiIcon

Hover to reveal

The default slot is the host; the extension slot is the cluster that appears. The root element is a span unless as names another tag. Hover the row — or tab into it — and the two actions slide in on the right; move the pointer away and they leave after a short delay. The Rust form renders a still, so the examples that show the extension use forceRevealed below.

TSX
budget-2026.tsv · 24 KB

Placement

placement picks the side the extension slides out from: right (the default), left, top or bottom. forceRevealed pins the extension: while it is set the hide timer never runs, so the cluster stays once it has appeared. The Rust snapshot applies it at render and shows all four extensions open; in the Vue preview, hover a row to see its direction. In the Vue form the extension slot also receives { revealed }, should the cluster need to know whether it is on screen.

Expands to the right (the default)
Expands to the left
Expands upward
Expands downward

Timing and touch

hideDelay is how long the extension stays after the pointer leaves (140ms by default). On a touch device there is no hover: with touchRevealMode="tap" any touch reveals it and it lingers for touchHideDelay; with "longpress" the finger must rest for longPressDelay first, so casual taps and swipes never flash the actions.

Press and hold on a touch screen

API

Vue

Props

NameTypeDefaultRequired
hideDelayNumber140—
touchHideDelayNumber3000—
touchRevealMode<code>String as PropType<"tap" | "longpress"></code>"tap"—
longPressDelayNumber500—
asString"span"—
placementString as PropType<HoverRevealPlacement>"right"—
forceRevealedBooleanfalse—

Emits

EventPayload
revealChangeboolean

Rust

Props — HoverRevealAction

PropTypeDefaultDescription
hide_delayf64140.0Mouse-leave hide delay in ms (Vue default 140).
touch_hide_delayf643000.0How long a touch-revealed extension lingers after the finger lifts (Vue default 3000).
touch_reveal_modeHoverRevealTouchModeHoverRevealTouchMode::TapWhen a touch reveals the extension (Vue default tap).
long_press_delayf64500.0Rest duration before a longpress reveal fires (Vue default 500).
as_tagString"span".to_string()The host tag (Vue prop as, default "span").
placementHoverRevealPlacementHoverRevealPlacement::RightPlacement side of the extension (Vue default right).
force_revealedboolfalsePin the extension open (Vue default false).
mainElement(empty)The main slot.
extensionOption<Element>NoneThe extension slot (the revealed action cluster).
on_reveal_changeOption<EventHandler<bool>>NoneVue's revealChange emit.

Notes

  • revealChange reports each transition with the new state, for a host that needs to know when the cluster is on screen.
  • In the Vue form forceRevealed is applied when it changes, not when the component mounts with it: a row that mounts pinned is revealed by its first hover and stays open from then on.
  • The Rust mirror keeps its state on the DOM node rather than in props, and binds only the mouse family: the touch knobs are read by a host that drives the exported touch machine itself.
  • The extension is pointer-events: none until it is revealed, so a click never lands on an invisible action.

Accessibility

  • Keyboard users get the extension through :focus-within: tabbing into the host reveals it before focus moves into it.
  • Do not hide the only way to reach an action behind hover: on a touch screen there is no hover, so offer the same actions in a menu as well, or keep touchRevealMode="tap".

Related components