Preview Only: These components are for reference only. Continue using Orbiter in production until further notice.

SegmentedControl

The SegmentedControl component presents a horizontal row of options or actions that are contextually or conceptually related. It allows users to select a single option at a time.

Usage

Selected

A segmented control can have an item initially selected, by using defaultSelectedKey for uncontrolled or selectedKey for controlled. Here's an example where one item is selected using defaultSelectedKey.

Size

A segmented control supports multiple sizes. Here’s an example demonstrating the medium size option:

Icon only

Items within a segmented control can contain only icons. An accessible name must be provided through aria-label prop. See also WCAG practices.

Icon

A segmented control can contain items with icons, starting or ending. Non standard starting icons can be provided to handle special cases. However, think twice before adding start icons, end icons should be your go to.

Justified

A segmented control can have items with similar widths.

Controlled

A segmented control can have a controlled selected value. In this example, it shows how it is possible to select an option.

Props

SegmentedControl

isDisabled?

Whether the segmented control is disabled.

isJustified?

Whether the items should divide the container width equally.

selectedKey?

The id of the currently selected item (controlled).

defaultSelectedKey?

The id of the initial selected item (uncontrolled).

size?

The size of the controls. *

Defaults to sm.
style?

The inline style for the element.

children?

The children of the component.

className?

The CSS className for the element.

SegmentedControlItem

id

The id of the item, matching the value used in SegmentedControl's selectedKey prop.

isDisabled?

Whether the item is disabled or not.

size?

The size of the item. *

Defaults to sm.
style?

The inline style for the element.

children?

The children of the component.

className?

The CSS className for the element.