SupplementInset

SupplementInset

HkSupplementInset is the supplementary slot of a button surface: a second control — a "…" menu button, a settings glyph — that takes no space while the surface is at rest and slides open beside the main control when the user hovers or focuses it, or when the host reveals it.

  • It is not a button itself. It lays out two sibling controls the host provides; for a standalone icon button use HkIconButton.
  • To hide a whole cluster of actions until a row is hovered, use HkHoverRevealAction, which overlays its extension instead of pushing the content aside.

Import

tsx
1
import { HkSupplementInset } from "@celestia-island/hikari";

This component ships in the Vue library only; it has no Rust mirror.

Structure

The component has two slots. default is the main control; supplement is the extra one. They end up as sibling controls inside one surface — the supplement must never be nested in the main button, since a button cannot hold a button. The width the supplement opens to is measured from its content, so the host never declares a pixel.

Hover and focus reveal

revealOnHover is on by default: moving the pointer over the inset, or focusing into it, opens the supplement's column — the main content is pushed left and the supplement fades in. The transition rides the animation context, so reduced-motion users get instant states.

TSX

Click to toggle

revealed is the controlled source: the host flips it — on a press of the already-active option, which is also the touch path where hover does not exist. closed is the host's press-off state: it keeps the supplement shut even under a lingering hover, so a toggle-off on a touch screen is observable instead of being undone by the sticky hover a tap leaves behind.

TSX

API

Vue

Props

NameTypeDefaultRequired
revealedBooleanfalse—
closedBooleanfalse—
revealOnHoverBooleantrue—

Accessibility

  • At rest the supplement is visibility: hidden: it is out of the accessibility tree and cannot be tabbed to. Revealing it flips the visibility at once — only the width and the opacity animate.
  • Keyboard users reach the supplement through focus-within: tabbing from the main control reveals the column before focus moves into it.
  • Give an icon-only supplement an aria-label of its own.

Related components