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
ComponentsTabThe Component UI for Tab is a navigation element that allows users to switch between different sections or views. It displays tab headers at the top, indicating the active tab and showing corresponding content below. It simplifies content organization and enhances user navigation within an application or webpage.
Guidelines
Design
v2.5.0
Updated
Vue
v2.0.0
Updated
Flutter
v2.0.0
Updated

Anatomy

Displays icons that provide additional visual context to the user. Icons are commonly used to help speed up the recognition of tab functions.
Provides a visualization of the active status of the current tab.
 Display descriptive text for each tab.
Variant on State
Tab Default
Tab Active
When a tab is active, usually its title or appearance is highlighted or a different color so that it is easily recognized by users.
Tab Error
The errors tab refers to situations where a problem or error occurs.
Tab Disable
When a tab is disabled, users typically cannot click or open it, and the tab may be displayed with a color or appearance that indicates it is inactive.
Tab Hover
Used to provide users with visual or interactive responses, such as color changes, animation effects, or the appearance of additional information.
Tab with Icon
Tab can include text along with icons
Notes
  • Circle as an instance of the swap component
  • Select icons from Material Design Icons for consistency and ease of recognition.
  • The icon alone can be confusing; add text for clarification. Use icons without text only if they are common, for example a cross (X) to close.

Usage

Tabs are components used to organise content into sections that are easily accessible without the need to switch pages. Use tabs in the following situations:

  • Use tabs to group related information into different categories, helping to reduce cognitive load.
  • Tabs can be used to organize content such as forms, settings, and dashboards so a user does not have to navigate away from their workflow to complete their task.
  • When screen space is limited and content needs to be organised in sections that can be hidden.

When Not to Use Tabs?

  • Don't use tabs if all the content can be displayed directly without causing confusion.
  • If there are too many tabs, consider other navigation methods such as dropdowns or sidebars to avoid visual overload.
Overflow Tab
Mobile Behavior
  • When the number of tabs exceeds the screen width on mobile devices, tabs should be horizontally scrollable using gesture scrolling. Users can swipe left or right to access hidden tabs.
  • Ensure that the size and readability of tabs and their text are maintained by using responsive units such as em or rem and media queries.

Desktop Behavior

  • If the number of tabs exceeds the screen width on desktop devices, hidden tabs should be collected under a 'More' dropdown. Clicking on this dropdown will display the list of additional tabs.
  • Apply a hover effect to the 'More' dropdown to indicate it is clickable.


Hover and click tab ‘More’
Dropdown list showing more tab option
The ‘More’ tab switched into selected tab

Accessibility

Tabs should be designed for inclusivity so that they can be used by all users, including those with physical or cognitive limitations.

  • Ensure tabs have a clear focus style (e.g. border or highlight) to support keyboard users.
  • Ensure that tab text, active indicators, and other elements have a minimum contrast ratio of 4.5:1 against the background.
  • Provide visual feedback such as hover states or colour changes to indicate which elements are being interacted with.
  • Ensure tabs work well on mobile devices with swipe gesture support as an alternative navigation.

Content

The content inside the tab should be informative, concise, and easy to understand.

  • Should be brief, usually 1-2 words, to provide a clear description of the content represented. Example: ‘Info’, “Settings”, “Reports”.
  • Arrange the tabs in a logical order based on the frequency or relevance of the content. The most frequently used tabs are usually placed in the first position.
  • Ensure that each tab only contains information that is relevant to its label. Avoid hiding too much important information within tabs.
  • If any tab is empty or contains dynamic data, provide fallback content such as ‘No data’ or ‘Select option to view content’.
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" />

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.

PropertiesData TypeDescription
controllerTabController?The controller for handle tabbar
tabsList<UITabBarItem>The collection items of UITabBarItem
onTapValueChanged<int>?Signature for callbacks that report that an underlying value, when user pressed item
UITabBar

A custom navigation tab bar. This navigation allows users to switch between different section or views. It displays tab header at the top, indicating the active tab and showing corresponding content below
arrow_back
Previous Switch
Next Table
arrow_forward