ButtonToggle

Overview

Button group showing 2 options, one of which must be active

Example : Default usage

_images/buttonToggle.png

import { ButtonToggle } from @ska-telescope/ska-gui-components’;

<ButtonToggle data={data} testId=”testId” />

Properties

Property

Type

Required

default

ariaDescription

string

No

Used by Screen Readers

ariaTitle

string

No

ButtonToggle

Used by Screen Readers

current

string

Yes

Value of the currently active element

disabled

boolean

false

Allows the group to be disabled

options

object

Yes

{ id: string, label: string, value: any}[] Max 2

setValue

function

Yes

Function to update the value when clicked

testId

string

No

SPECIAL

Value is “telescopeSelectorId” for this component

toolTip

string

No

‘’

Optional toolTip for the toggle

value

object

Yes

Object of the currently active element

Constants

none

Testing Identifier

Provided by the property testId