Base

  • Colors
  • Icons
  • Logos
  • Shadows and Elevations
  • Spacing
  • Typography

Components

  • Accordion
  • Avatars
  • Badges
  • Buttons
  • Cards
  • Character Counter
  • Device Type Icons
  • Draggables
  • Dropdowns
  • Droppables
  • Expandable image
  • Filters
  • Gallery card
  • Icon Button
  • Indicators
  • Lightbox image
  • Lists
  • Loading
  • Messages
  • Pictogram
  • Poster Play
  • Progress bar
  • QR Code
  • Rating stars
  • Row Selector
  • Segmented Controls
  • Sentiment
  • Split View
  • Tables
  • Tags
  • Tester vitals
  • Toggle button
  • Typeahead

Form

  • Checkbox
  • Combobox
  • Form Rule
  • Hint
  • Input
  • Input Title
  • Label
  • Multi-select List
  • Search
  • Select
  • Single-select List
  • Sliders
  • Switch
  • Text Area

Layout

  • Containers
  • Layers
  • Layout
  • Split Layout
  • Wrappers

Navigation

  • Context Switcher
  • Nav bar
  • Navigation
  • Pagination
  • Sidebar Navigation
  • Step Navigation
  • Tabs

Overlay

  • Banners
  • Bulk Selector
  • Modals
  • Popovers
  • Toast
  • Tooltips
  • User Notifications

Patterns

  • Full Page Message
  • Question card & Group Questions Container

Visualizations

  • Data Colors

Segmented Controls

Use segment controls for mutually exclusive selections that directly controls another component.

This component is only available in the userTestingNext theme.

Setting options

Expand Copy
<tk-segmented-controls options="options">
</tk-segmented-controls>

Description

Pass the component an options prop to render the controls. The properties section at the bottom of this page describes the expected data model.

Size: small

Expand Copy
<tk-segmented-controls options="options" size="small">
</tk-segmented-controls>

Size: large

Expand Copy
<tk-segmented-controls options="options" size="large">
</tk-segmented-controls>

Disabling an option

Expand Copy
<tk-segmented-controls options="options">
</tk-segmented-controls>

Description

To disable an option, set the disabled key of the option object to true.

Completely disabled

Expand Copy
<tk-segmented-controls options="options">
</tk-segmented-controls>

Description

To disable all options, set the disabled key of every option object to true.

Listening for selection

Expand Copy
<!-- for demo purposes only -->
<tk-highlight id="exampleSegmentedControlsOutput" class="l-block"></tk-highlight>

<tk-segmented-controls options="options">
</tk-segmented-controls>

Description

Upon selecting a control, the controlSelect event is emitted. It contain a detail property equal to the value of the clicked option.

Prefilled value

Expand Copy
<tk-segmented-controls options="options" selected="monthly">
</tk-segmented-controls>

Description

Pass the component a selected prop which matches the value of the option that you’d like prefilled.

Fill container

Expand Copy
<tk-segmented-controls options="options" fill-container>
</tk-segmented-controls>

Description

By default, options are as wide as their content. To have them grow to the width of their container, set fill-container.

Using icons




Expand Copy
<tk-segmented-controls options="options" size="small">
</tk-segmented-controls>
<hr>
<tk-segmented-controls options="options">
</tk-segmented-controls>
<hr>
<tk-segmented-controls options="options" size="large">
</tk-segmented-controls>
<hr>
<tk-segmented-controls options="options" fill-container="true">
</tk-segmented-controls>

Color variants

Expand Copy
<div>
  <tk-segmented-controls variant="blue-50" options="options"></tk-segmented-controls>
</div>
<div>
  <tk-segmented-controls variant="blue-100" options="options"></tk-segmented-controls>
</div>

Description

There’s a total of 3 different color variations for this component. grey-50 is the default.

tk-segmented-controls

Properties

Property Attribute Description Type Default
fillContainer fill-container Used to equally split the available container width over the controls boolean false
options An array of controls to render. This must be an array of objects of the SegmentedControlsOption type. An optional “disabled” key can be set within the object to render a control as disabled. SegmentedControlsOption[] undefined
selected selected A value that, if matching one of the options’ values, will be preselected. string ''
size size Controls the size of the button "large" | "medium" | "small" 'medium'
variant variant "blue-100" | "blue-50" | "neutral-50" 'neutral-50'

Events

Event Description Type
controlSelect Emits whenever a control is selected CustomEvent<string>