Buma UI - DocumentationBuma UI - Documentation
Get Started
Foundations
Components
Resources
Patterns
Data Visualization
Back to BSpace
Get Started
Foundations
Components
Resources
Patterns
Data Visualization
  • stacksFoundations
    • 💡 Overview
    • Color
    • Principle
    • Typography
  • brickComponents
    • 💡 Overview
    • Accordion
    • Alert
    • Avatar
    • Badge
    • Bottom Sheet
    • Bread Crumb
    • Button
    • Button Link
    • Button Navigation
    • Calendar
    • Card
    • Chat
    • Checkbox
    • Chips
    • Choice Tile
    • Comment
    • Date Picker
    • Divider
    • Download
    • Drawer
    • Dropdown
    • Empty State
    • Floating Button
    • Form Input
    • Header
    • Hint
    • Icon
    • List Choice
    • Loading
    • Modal
    • Navigation Bar
    • Notification
    • Pagination
    • Progress Bar
    • Radio Button
    • Search
    • Scrolling Bar
    • Segmented Switch
    • Side Menu
    • Side Tab
    • Slider
    • Switch
    • Tab
    • Table
    • Text Area
    • Text Input
    • Time Picker
    • Title
    • Toast
    • Tooltip
    • Wizzard
  • splitscreenPattern
    • 💡 Overview
    • Filter
      upcoming
    • Form
      upcoming
    • Notification
    • PWA
      upcoming
    • table
      upcoming
    • Upload Download
      upcoming
  • insert_chartData Visualization
    • 💡 Overview
    • Tiering
    • Pattern
    • Chart and Graph
      • Chart Selection Guide
      • Map Selector
      • Donut Chart
      • Donut Progress Bar Chart
      • Spider Chart
      • Line Chart
      • Chart Area
      • Speedometer
      • Heat Map
      • Scatter Plot
      • Pie Chart
      • Bar Chart
      • Waterfall Chart
      • Sunburst Chart
      • Tree Decomposition Chart
      • Scorecards
      • Table
      • Micro Visualization
    • Typography
    • Color Palette
  • data_objectTokens
    upcoming
  • inventory_2Resources
    • 💡 Overview
    • Mobile
      new
      • 💡 Introduction
      • Installation
      • General
        • Important Rules
        • Naming Convention
        • Clean Architecture
    • Web
      upcoming
ComponentsSegmented SwitchSegmented switches in interface design are interactive components that allow users to toggle between multiple options or states by selecting a segment within a segmented control
Guidelines
Design
v2.5.0
Updated
Vue
v2.0.0
Updated
Flutter
v2.0.0
Updated

Anatomy

 Highlights the currently selected option.
 The text inside each segment that describes the option.
 The outer structure that holds all segments together.
Segmented Switch Type
Primary
The main style that stands out, suitable for the primary option.
Secondary
A more subtle style, suitable for secondary or alternative choices.
Segmented Switch Type
Large (Default)

Suitable for more prominent designs or larger spaces.

Small

Suitable for compact designs or limited space.

Segmented Switch State
Default
The default state (unselected).
Default Hover
The state when the mouse hovers over the switch in its default state.
Active
The state when the option is active (selected).
Active Hover
The state when the mouse hovers over the switch in its active state.
Segmented Switch Variant
Text Only

Use this variant when you want to display only text without any icons. It is best for cases where you want the options to be purely text-based, offering a clean and minimalistic approach. This variant is ideal for simple choices where an icon might not add meaningful context.

Left Icon

Use this variant when you want to add an icon to the left of the text. This is helpful when the icon helps to clarify or represent the option’s purpose. It’s useful for indicating the type of action or content the user is selecting.

Right Icon

The icon in this variant can be replaced with other elements, such as a hint. A hint typically refers to a numerical indicator, like showing the number of outstanding tasks or notifications. This element provides additional context, such as the number of pending actions that the user should be aware of, making the interaction more informative.

You can use hint on segmented switch. Use hints to show the number of tasks left (e.g., "3 tasks remaining").

Icon Only

Use this variant when you only need to display an icon without any text. It’s ideal for situations where the icon alone is clear enough to communicate the action or option. This variant is used when space is limited or when the icon is intuitive enough to stand alone.

Since the icon is the only visual element, it is recommended to use a tooltip for accessibility. A tooltip will provide a text explanation of what the button does when the user hovers over it, ensuring clarity for users who might not immediately recognize the icon.

Invert Color Usage

The segmented switch has an invert color variant to ensure visibility based on the background:

  • Invert Color On: Use when the background is white. The segmented switch will use a light background for active states and a white background for inactive states.
  • Invert Color Off: Use when the background is light. The segmented switch will use a white background for active states and a light background for inactive states.

Select the appropriate variant based on the background to maintain contrast and usability.

Invert Color Off
Invert Color On


Usage

Usage Recommendation:

  • Use the segmented switch when users need to toggle between mutually exclusive options within a small dataset (e.g., switching between tabs like "Monthly" and "Yearly").
  • When you need to display distinct views for varying content within the same context.
  • During a user journey (e.g., filling out a form or adjusting settings), utilize segmented switch to structure related content and keep the user within the main page.

Examples of Appropriate Use:

  • Switching between views (e.g., "List" vs. "Grid").
  • Filter options (e.g., "All", "Completed", "Pending").


Accessibility

If the number of options exceeds the available space or the labels are too long to fit in a single row, truncate text to ensure proper alignment. The segmented switch is not designed to accommodate scrolling.

Do's
Don't


Content


  • Keep labels short, ideally one to three words.
  • Use sentence case for text labels (e.g., "Need Approval" instead of "NEED APPROVAL").
  • Ensure labels are distinct and unambiguous. Don’t make unclear label.
  • Use consistent label styles within the same switch.
Do's
Don't
Do's
Don't
Web
Resources You can use these components by accessing the provided resource files.

Usage

The package is already installed in the repository's shell. To use the component, you only need to add the following code:

<BTab :items="ItemTypes" switch/>

Attributes

If there is a question mark ? in the Data Type, it means that the properties are optional.

NameData TypeDescriptionDefault Value
itemsItemTypes[]Array of tab items.none
verticalbooleanEnables vertical tabsFalse
switchbooleanChanges tabs to switch type.False
smallbooleanSets the tab to small size.false
itemFullBlockbooleantab item occupies the full block space.False
itemClassstringCustom class to style the itemnone
linkClassstringCustom class to style the linknone
idstringID for the tab.none
iconstringIcon for the tab.none
hintnumberHint number displayed on the tab.none
dropdownOptionDropdownOption[]Dropdown options for the tab.none

ItemTypes

The <BTab /> items must be defined using the following structure. If there is a question mark ? in the Data Type, it means that the properties are optional:

VariantData TypeDescriptionDefault Value
idstringUnique identifier for the tab.none
textstringText displayed on the tab.none
icon?string Icon for the tabnone
hint?numberHint number displayednone
disabled?booleanDisables the tab if set tofalse
Mobile
Resources
  • You can use these components by accessing the provided resource files.
  • Preview animations are examples and may not suit Mobile Widgets. Press 'View Code' to access the Widgetbook Playground and see the Flutter widget displaying all created components and interactive.

Usage

Import this line to your file:

import 'package:buma_design_system/buma_design_system.dart';

Attributes

If there is a question mark ? in the Data Type, this widget has 2 variants: primary & secondary

PropertiesData TypeDescription
itemsList<UISegmentedSwitchItem>A collections item of UISegmentedSwitchItem
initialIndexintA current position for first initialization
variantUISegmentedSwitchVariantA variant to make different segmented switch
sizeUISegmentedSwitchSizeA type to create padding content spacing
onTapValueChanged<int>Signature for callbacks that report that an underlying value, when user pressed item
Segmented Switch Primary
Segmented Switch Secondary
arrow_back
Previous Scrolling Bar
Next Side Menu
arrow_forward