Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Blocks
  2. Control Island
  3. API and Development

Control Island

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Import ControlIsland, ControlIslandStatus, ControlIslandVariant from @prepared911/ui/blocks/control-island. See props.ts for the props and schema.ts for the declaration (inputs and variants). variant is the discriminant of a union: each variant takes only its own props.
Every variant
PropTypeDefault
variantControlIslandVariantrequired
labelLocalizedMessagerequired
sizeButtonSizeMedium
classNamestringnone
idstringnone
refRef<HTMLDivElement>none
ControlIslandVariant: Supervisor, Calltaker, Dispatcher. ref, id, and className land on the island (Calltaker, Dispatcher) or on the host around the ButtonGroup (Supervisor).
Supervisor
PropTypeDefault
itemsreadonly ControlIslandRoleItem[]required
valueDisplayValue | nulluncontrolled
defaultValueDisplayValue | nullnone
onValueChange(value: DisplayValue, details: ChangeDetails) => voidnone
ControlIslandRoleItem: value (DisplayValue), icon (Glyph), label (LocalizedMessage), optional disabled.
Calltaker and Dispatcher
PropTypeDefault
roleIconGlyphrequired
roleLabelLocalizedMessagerequired
queueLabelLocalizedMessagerequired
raiseHandIconGlyphrequired
raiseHandLabelLocalizedMessagerequired
raisedHandbooleanuncontrolled
defaultRaisedHandbooleanfalse
onRaisedHandChange(raised: boolean, details: ChangeDetails) => voidnone
Calltaker only
PropTypeDefault
statusControlIslandStatus (Busy, Ready, Ringing)uncontrolled
defaultStatusControlIslandStatusBusy
onStatusChange(status: ControlIslandChoosableStatus, details: ChangeDetails) => voidnone
busyLabelLocalizedMessagerequired
readyLabelLocalizedMessagerequired
ringingLabelLocalizedMessagerequired
statusMenuLabelLocalizedMessagerequired
ringingAnnouncementLocalizedMessagerequired
statusMenuIconGlyphrequired
ringingIconGlyphrequired
ControlIslandChoosableStatus is Busy | Ready. The Dispatcher variant types status, defaultStatus, and onStatusChange as never.
Props
NameTypeDefaultDescription
busyLabelLocalizedMessage—Label of Busy, on the pill and on its menu row.
itemsreadonly ControlIslandRoleItem[]—The roles in display order. The island does not know which roles exist, so the host supplies all of them.
labelLocalizedMessage—Accessible name of the island (role="group"), such as "Role and availability".
queueLabelLocalizedMessage—The queue (Calltaker) or channel (Dispatcher) the person is working, such as "All queues". Static text.
raiseHandIconGlyph—Glyph of the raise hand control.
raiseHandLabelLocalizedMessage—Name of the raise hand control, such as "Raise hand". It does not change with the pressed state.
readyLabelLocalizedMessage—Label of Ready, on the pill and on its menu row.
ringingAnnouncementLocalizedMessage—Announced politely once when the status becomes Ringing, such as "Incoming call".
ringingIconGlyph—Glyph before the label of the Ringing pill.
ringingLabelLocalizedMessage—Label of Ringing, on the pill.
roleIconGlyph—Glyph inside the accent role badge.
roleLabelLocalizedMessage—Name of the role, such as "Calltaker". The badge shows only the glyph, so this is its accessible name.
statusMenuIconGlyph—Glyph after the label of the Busy and Ready pill, the chevron that says the pill opens a menu.
statusMenuLabelLocalizedMessage—Name of the availability menu, such as "Availability". It names the radio group and describes the pill.
variantControlIslandVariant—The Supervisor island is an Expanding ButtonGroup of roles. The Calltaker island ends in the availability pill. The Dispatcher island has no availability control.
classNamestring—Classes appended to the island's host.
defaultRaisedHandbooleanfalseInitial raised state when uncontrolled.
defaultStatusControlIslandStatusControlIslandStatus.BusyInitial availability when uncontrolled. A dispatcher has no availability; use {@link ControlIslandVariant.Calltaker}.
defaultValueDisplayValue | null—Value of the selected role on first render when uncontrolled.
idstring—Id of the island's host element.
onRaisedHandChange((raised: boolean, details: ChangeDetails<ChangeReason>) => void)—Called with the next state when the raise hand control is pressed. Cancel the details to keep the previous state. @param raised - Next raised state @param details - Change metadata
onStatusChange((status: ControlIslandChoosableStatus, details: ChangeDetails<ChangeReason>) => void)—Called with the chosen availability when a row of the status menu is pressed. It is never called with Ringing, which is not a choice. Cancel the details to keep the previous availability. A dispatcher has no availability; use {@link ControlIslandVariant.Calltaker}. @param status - The chosen availability @param details - Change metadata
onValueChange((value: DisplayValue, details: ChangeDetails<ChangeReason>) => void)—Called when a role segment is pressed, with ChangeReason.ItemPress. Pressing the selected role does not call it. Cancel the details to keep the previous role. @param value - The pressed role's value @param details - Change metadata
raisedHandboolean—Whether the hand is raised when controlled. Pair with onRaisedHandChange.
refRef<HTMLDivElement>—Ref to the island's host element.
sizeButtonSizeButtonSize.MediumControl height of the island's controls, from the shared scale (ADR 0012). The role segments, the badge, the raise hand control, and the status pill all follow it. A pill is the control height plus its 1px edge on each side, and the island is a pill plus a 4px inset on each side: Medium is a 38px island with 30px pills.
statusControlIslandStatus—Availability when controlled. The host sets {@link ControlIslandStatus.Ringing} while a call is incoming and sets the person's choice back when it ends: the island keeps no memory of the choice that Ringing replaced. A dispatcher has no availability; use {@link ControlIslandVariant.Calltaker}.
valueDisplayValue | null—Value of the selected role when controlled; null selects none.
Storybook
Interactive examples and edge cases for this component are in Storybook.
DefaultOpens in a new tab
Previous
Control Island / Usage
Next
Control Island / Accessibility
On this page
Every variant
Supervisor
Calltaker and Dispatcher
Calltaker only
Props
Storybook