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
ComponentsSwitchA switch button is a user interface element that toggles between two states, typically on and off, allowing users to enable or disable a specific setting or feature.
Guidelines
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:

<BSwitch />

Attributes

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

PropertiesData TypeDescriptionDefault Value
idstring?Identifier for the switch buttonnone
modelValuestringThe value of the switch buttonnone
disabledbooleanDisables the switch buttonnone
requiredbooleanMarks the switch as requirednone
inputClassstringAdds a custom class to the input elementnone
variantstringSwitch variant (e.g., color style)primary
smallbooleanRenders a smaller version of the switchnone
labelOnstring?Label displayed when the switch is "on"none
labelOffstring?Label displayed when the switch is "off"none
disabledLabelstring?Label displayed when the switch is disablednone
noLabelbooleanHides the label for the switchnone
filledbooleanApplies a filled style to the switchnone
labelstring?Label text for the switchnone

Variant

The <BSwitch> component supports the following variants:

variantDescription
primaryswitch use primary color
dangerswitch use danger color

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, it means that the properties are optional.

PropertiesData TypeDescription
valueT?Displays value of actions.
labelString?Displays additional label right of different action widget.
isFilledboolMake action has container, background and bordered.
isErrorboolWhen user interface indicates that something has gone wrong or that user input is incorrect or invalid
onChangedValueChanged<T?>?Callback when action has changed.

Previews & Code

You can call the components with Class.namedConstructor() with different variants.

Switch

This switch variant includes a hierarchical design, where a parent switch dynamically reflects the state of its child switches. If all child switches are enabled, the parent switch turns on; if none are enabled, it turns off. A mixed state is indicated when some, but not all, child switches are enabled.
arrow_back
Previous Slider
Next Tab
arrow_forward