LogoLogo
  • Release Notes
  • Downloads
  • Frequently Asked Questions
  • Developers
    • Introduction
    • Color Variables
    • Font Family
    • Vanilla JS
    • React
    • Vue
    • Angular
    • RTL Support
    • Light Mode/Dark Mode
  • Foundations
    • Typography
    • Colors
    • Icons & Visuals
    • Images
    • Layout & Breakpoints
    • Utils
    • Usability Guidelines
  • Components
    • Accordions
      • Accordion
      • Accordion Groups
    • Alert
    • Attach File
    • Avatar
    • Banner Cards
    • Breadcrumbs
    • Buttons
      • Button
      • Icon Button
      • Link Button
      • Social Media Buttons
      • Split Button
    • Checkbox
      • Checkbox Input
      • Checkbox Groups
    • Chips
    • Credit Card
    • Credit Card Input Field
    • Header
    • Interactive Banner
    • Number Field
    • Menu
    • Pagination
    • Phone Number Field
    • Progress Indicators
      • Expectation Levels
      • Progress Bar
      • Progress Circle
      • Progress Semi-Circle
    • Quick Select Field
    • Radio Buttons
      • Radio Input
      • Radio Buttons Groups
    • Search Input Field
    • Segmentation
      • Segmented Controls
      • Segmented Tabs
    • Select Input Field
    • Slider
    • Steps
      • Stepper
      • Step Indicator
    • Sticky Bar
    • Tabs
    • Text Area Field
    • Text Field
    • Toggle Switch
    • Tooltip
Powered by GitBook
On this page
  • Overview
  • Usage
  • When to use this component?
  • How it works
  • Code
  • Properties
  • Anatomy
  • Anatomy Options
  • Dos and Don'ts
Export as PDF
  1. Components
  2. Segmentation

Segmented Controls

Segmented Controls are used for areas of the UI that require simple configuration options in a compact manner

PreviousSegmentationNextSegmented Tabs

Last updated 12 days ago

Overview

Usage

When to use this component?

Segmented controls are ideal when users need to choose between a few distinct options, such as in settings panels, toolbars, or other interfaces requiring quick configuration changes. They work well for toggling between related options where only one selection is allowed at a time.

How it works

Segmented controls present a series of related options in a compact, unified interface. Users select one option, which updates the control’s state to reflect their choice. Each segment displays different states—such as selected or unselected—providing clear visual feedback on the current configuration.

Code

<dda-segmented-tabs
    radius_type="square"
    custom_class=""
    component_mode=""
    button_name="button"
    items='["All","Recent","Saved"]'
></dda-segmented-tabs>
<DdaSegmentedTabs
    radius_type="square"
    custom_class=""
    component_mode=""
    button_name="button"
    items='["All","Recent","Saved"]'
></DdaSegmentedTabs>
<DdaSegmentedTabs
    radius_type="square"
    custom_class=""
    component_mode=""
    button_name="button"
    items='["All","Recent","Saved"]'
></DdaSegmentedTabs>
<dda-segmented-tabs
    radius_type="square"
    custom_class=""
    component_mode=""
    button_name="button"
    items='["All","Recent","Saved"]'
></dda-segmented-tabs>

Properties

Property
Description
Type

component_mode

Optional parameter that defines a specific mode or variant of the component. options are 'light' or 'dark'.

string

custom_class

Additional CSS class(es) to be applied to the segmented tabs container. Allows for custom styling and modifications.

string

items

A JSON string that will be parsed into an array of strings. Each string represents a tab item. If an item starts with 'fo', it will be rendered as a Material Icons icon; otherwise, it will be rendered as text.

  • Example: '["Home", "fohouse", "Settings"]'

string

radius_type

Determines the border radius styling of the segmented tabs group. Applied as a CSS class to the container element.

  • Example: 'rounded' or 'square'

string

buttons_name

Name attribute for the segment buttons

string

Anatomy

Anatomy Options

Lead-Icon: Positioned at the start of the segmented control to provide a visual cue related to the content.

Segment Label: Describes the segment, indicating different sections within the control (e.g., "All," "Recent," "Saved").

Divider: Separates the segments visually, creating clear boundaries between each selectable option.

Trail-Icon: Positioned at the end of the segmented control, providing an additional visual element for context or functionality.

Dos and Don'ts

Dos
Don'ts

Use segmented controls to group related options that are mutually exclusive.

Don't use segmented controls for actions that can be performed simultaneously.

Label each segment clearly to indicate its purpose.

Avoid using vague or unclear labels for segments.

Ensure each segment is large enough to be easily tapped or clicked.

Don't make segments too small to interact with comfortably.

Use segmented controls in contexts where quick and frequent configuration changes are needed.

Avoid using segmented controls for complex configurations that require detailed input.

Provide visual feedback to indicate the selected segment.

Don't leave the user guessing which segment is currently selected.

Keep the number of segments manageable to avoid overwhelming the user.

Don't use too many segments, which can reduce usability and clarity.