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.
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.
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
Expands to the right (the default)
Expands to the left
Expands upward
Expands downward
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import{HkHoverRevealAction,HkIconButton}from"@celestia-island/hikari";importtype{CSSProperties}from"vue";constcolumn: CSSProperties={display:"flex",flexDirection:"column",gap:"48px",alignItems:"flex-start"};constrow: CSSProperties={display:"flex",gap:"12px",alignItems:"center",padding:"8px 12px",border:"1px solid #e4e4e7",borderRadius:"6px",};constplacements=[{placement:"right",caption:"Expands to the right (the default)"},{placement:"left",caption:"Expands to the left"},{placement:"top",caption:"Expands upward"},{placement:"bottom",caption:"Expands downward"},]asconst;exportdefault()=>(<divstyle={column}>{placements.map(({placement,caption})=> (
<div key={placement}style={row}><HkHoverRevealActionplacement={placement}forceRevealedv-slots={{
default:()=><span>{caption}</span>,
extension: () => <HkIconButton icon="Pencil" size={24} aria-label="Edit" />,}}
/></div>
))}
</div>);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
letedit=||rsx!{
IconButton { icon:Some(MdiIcon::Pencil), size:IconButtonSize::S24, aria_label:Some("Edit".to_string())}};rsx!{
div { style:"display:flex;flex-direction:column;gap:48px;align-items:flex-start",
div { style:"display:flex;gap:12px;align-items:center;padding:8px 12px;border:1px solid #e4e4e7;border-radius:6px",
HoverRevealAction {
force_revealed:true,
main:rsx!{ span {"Expands to the right (the default)"}},
extension:Some(edit()),}}
div { style:"display:flex;gap:12px;align-items:center;padding:8px 12px;border:1px solid #e4e4e7;border-radius:6px",
HoverRevealAction {
placement:HoverRevealPlacement::Left,
force_revealed:true,
main:rsx!{ span {"Expands to the left"}},
extension:Some(edit()),}}
div { style:"display:flex;gap:12px;align-items:center;padding:8px 12px;border:1px solid #e4e4e7;border-radius:6px",
HoverRevealAction {
placement:HoverRevealPlacement::Top,
force_revealed:true,
main:rsx!{ span {"Expands upward"}},
extension:Some(edit()),}}
div { style:"display:flex;gap:12px;align-items:center;padding:8px 12px;border:1px solid #e4e4e7;border-radius:6px",
HoverRevealAction {
placement:HoverRevealPlacement::Bottom,
force_revealed:true,
main:rsx!{ span {"Expands downward"}},
extension:Some(edit()),}}}}
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
Press and hold on a touch screen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import{HkHoverRevealAction,HkIconButton}from"@celestia-island/hikari";importtype{CSSProperties}from"vue";constrow: CSSProperties={display:"flex",gap:"12px",alignItems:"center",padding:"8px 12px",border:"1px solid #e4e4e7",borderRadius:"6px",maxWidth:"420px",};exportdefault()=>(<divstyle={row}><HkHoverRevealActionhideDelay={400}touchRevealMode="longpress"longPressDelay={600}forceRevealedv-slots={{
default:()=><span>Pressand hold on a touch screen</span>,extension:()=><HkIconButtonicon="Pencil"size={24}aria-label="Edit"/>,
}}
/></div>
);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
rsx!{
div { style:"display:flex;gap:12px;align-items:center;padding:8px 12px;border:1px solid #e4e4e7;border-radius:6px;max-width:420px",
HoverRevealAction {
hide_delay:400.0,
touch_reveal_mode:HoverRevealTouchMode::LongPress,
long_press_delay:600.0,
force_revealed:true,
main:rsx!{ span {"Press and hold on a touch screen"}},
extension:Some(rsx!{
IconButton { icon:Some(MdiIcon::Pencil), size:IconButtonSize::S24, aria_label:Some("Edit".to_string())}}),}}}
rsx! {
div { style: "display:flex;gap:12px;align-items:center;padding:8px 12px;border:1px solid #e4e4e7;border-radius:6px;max-width:420px",
HoverRevealAction {
hide_delay: 400.0,
touch_reveal_mode: HoverRevealTouchMode::LongPress,
long_press_delay: 600.0,
force_revealed: true,
main: rsx! { span { "Press and hold on a touch screen" } },
extension: Some(rsx! {
IconButton { icon: Some(MdiIcon::Pencil), size: IconButtonSize::S24, aria_label: Some("Edit".to_string()) }
}),
}
}
}
API
Vue
Props
Name
Type
Default
Required
hideDelay
Number
140
—
touchHideDelay
Number
3000
—
touchRevealMode
<code>String as PropType<"tap" | "longpress"></code>
"tap"
—
longPressDelay
Number
500
—
as
String
"span"
—
placement
String as PropType<HoverRevealPlacement>
"right"
—
forceRevealed
Boolean
false
—
Emits
Event
Payload
revealChange
boolean
Rust
Props — HoverRevealAction
Prop
Type
Default
Description
hide_delay
f64
140.0
Mouse-leave hide delay in ms (Vue default 140).
touch_hide_delay
f64
3000.0
How long a touch-revealed extension lingers after the finger lifts (Vue default 3000).
touch_reveal_mode
HoverRevealTouchMode
HoverRevealTouchMode::Tap
When a touch reveals the extension (Vue default tap).
long_press_delay
f64
500.0
Rest duration before a longpress reveal fires (Vue default 500).
as_tag
String
"span".to_string()
The host tag (Vue prop as, default "span").
placement
HoverRevealPlacement
HoverRevealPlacement::Right
Placement side of the extension (Vue default right).
force_revealed
bool
false
Pin the extension open (Vue default false).
main
Element
(empty)
The main slot.
extension
Option<Element>
None
The extension slot (the revealed action cluster).
on_reveal_change
Option<EventHandler<bool>>
None
Vue'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
HkIconButton — the usual content of the extension slot.
HkSupplementInset — a supplementary control inside one button surface.