IconButtonGroup

IconButtonGroup

HkIconButtonGroup is the icon-only member of the button-group family: a row of icon buttons that form ONE control. It has three modes that decide what the group means — buttons, an action strip; single, a radio group; multiple, a toggle set — and three visual treatments that are independent of the meaning: track (the default), plain and slider.

  • Independent actions that merely share a row are separate HkIconButtons, each with its own frame and spacing. A group is a selector, or a toolbar whose commands belong together.
  • For a text version of the same strip see the tabs family; this component is the same grammar without captions.

Import

tsx
1
import { HkIconButtonGroup, type HkIconButtonGroupOption } from "@celestia-island/hikari";
rust
1
2
use hikari_components::*;          // IconButtonGroup, IconButtonGroupMode, …
use hikari_components::prelude::*; // rsx!, VNode, Icon, MdiIcon, HkIconButtonGroupOption

Action strip

In the default buttons mode the group holds no selection: every press fires select with the option's key. Each item takes its tooltip from its label, and that label is also the accessible name of the icon-only button — which is why it is required.

Single selection

With mode="single" the group is a radio group: one active key, v-model carries it, and pressing the already active item does nothing. The slider variant puts a sliding thumb behind the active item; it exists only in this mode.

Multiple selection

With mode="multiple" every item toggles independently and v-model is the array of active keys; each item publishes aria-pressed. Here two of the three are active.

Treatments, sizes and disabled items

track is the framed inset strip, plain drops the frame and lets each item tint its own active state, slider adds the thumb. The three sizes — sm, md (the default), lg — are one step taller than the icon button's. A single option can be disabled while its neighbours stay live; the group's own disabled prop locks every item.

Interaction

update:modelValue reports the next value — a string in single mode, an array in multiple mode — and select fires right after it with the key that was pressed. The group is controlled: the host owns the value. The example switches the view; the Rust mirror is controlled in the same way (value / values plus on_value_change), so it has no separate snapshot here.

TSX
Current view: table

API

Vue

Props

NameTypeDefaultRequired
optionsasPropType<HkIconButtonGroupOption[]>(Array)—✓
modelValue<code>[String, Array] as PropType<string | string[] | null></code>null—
mode<code>String as PropType<"buttons" | "single" | "multiple"></code>"buttons"—
variant<code>String as PropType<"track" | "plain" | "slider"></code>"track"—
size<code>String as PropType<"sm" | "md" | "lg"></code>"md"—
disabledBooleanfalse—
tooltipPlacementString as PropType<TooltipPlacement>"top"—
tooltipDelayNumber300—

Emits

EventPayload
update:modelValue<code>string | string[]</code>
selectstring

Rust

Props — IconButtonGroup

PropTypeDefaultDescription
optionsVec<HkIconButtonGroupOption>[]The items, in render order.
valueOption<String>NoneThe active key — read in single mode only (None = nothing active).
valuesVec<String>[]The active keys — read in multiple mode only (empty = nothing active).
modeIconButtonGroupModeIconButtonGroupMode::ButtonsThe semantic mode (radiogroup / toggle set / plain action strip).
variantIconButtonGroupVariantIconButtonGroupVariant::TrackThe visual treatment, orthogonal to mode.
sizeIconButtonGroupSizeIconButtonGroupSize::MdThe size step (also picks the glyph size).
disabledboolfalseKill the whole group: every item renders disabled and no click fires (Vue: disabled).
tooltip_placementTooltipPlacementTooltipPlacement::TopWhere the per-item tooltip is anchored (Vue: tooltipPlacement).
tooltip_delayu32TOOLTIP_DEFAULT_DELAY_MS (300)Milliseconds before the tooltip appears (Vue: tooltipDelay, 300 — the same default the mirrored Tooltip carries).
aria_labelOption<String>NoneThe group's accessible name.
classString""Extra class appended to the root class list (Vue: class fallthrough).
on_selectOption<EventHandler<String>>NoneAn item was activated (or toggled).
on_value_changeOption<EventHandler<IconButtonGroupValue>>NoneThe v-model ring: fires BEFORE on_select, with the value Vue's update:modelValue would carry for this mode.

Accessibility

  • Every option needs a label: it is the accessible name of an icon-only button and the default text of its tooltip. An empty tooltip on an option suppresses the tooltip, never the name.
  • single mode publishes role="radiogroup" and aria-checked on the items; multiple publishes aria-pressed.
  • All items are tabbable in every mode — the keyboard reaches each one, but the group does not implement a roving tabindex.

Related components

  • HkIconButton — the single icon button the group is built of.
  • Button — the text button of the same family.
  • HkFab — a floating button whose speed dial is a vertical strip of labelled actions.