Lowcoder Documentation
  • Lowcoder overview
    • The "Hello World" walk
  • 🆕Setup and run
    • Cloud & Private Cloud
    • Self-hosting
      • Google Cloud Platform
      • Easypanel
      • Heroku
      • Raspberry Pi
      • Access local database or API
      • Update MongoDB Versions
      • Lowcoder Version Update
      • Traefik loadbalancer
      • SMTP Server
      • Migration from Openblocks
    • Security
    • Lowcoder Enterprise Edition
      • Ordering the Enterprise Edition
      • Installing Enterprise Edition
      • Enterprise Edition Features
        • Environments
          • Setting up an Environment
          • Environment Details
        • Audit Logs
        • App Usage Analytics
        • Branding & Whitelabel
  • 🏨Workspaces & Teamwork
    • Workspaces
      • Multi-Workspace Mode
      • Single Workspace Mode
    • Members and Groups
    • Permissions for Resources
    • OAuth
      • KeyCloak
      • Google
      • GitHub
      • Generic OAuth Provider
    • Query library
    • Lowcoder Marketplace
  • ✨Build Applications
    • Create a new App
      • App(s) Navigation
      • Modules
      • Version and Release Management
    • App Editor
      • Query & Editing Roundtrips
      • Bulk Editing
      • Keyboard shortcuts
      • Data selection & Javascript
      • Layers
      • Visual Components
        • Common Component Settings
        • Messages / Toast
        • Dashboard & Reporting
          • Table
          • Charts and graphs
            • Bar Chart
            • Line Chart
            • Pie Chart
            • Scatter Chart
            • CandleStick Chart
            • Funnel Chart
            • Gauge Chart
            • Graph Chart
            • Heatmap Chart
            • Radar Chart
            • Sankey Chart
            • Suburst Chart
            • Theme River Chart
            • Tree Chart
            • Treemap Chart
            • Mermaid Chart
          • Google Maps
          • Timeline
        • Layout & Navigation
          • List View
          • Drawer
          • Modal
          • Navigation
          • Cascader
          • Tree / Tree Select
          • Link
          • Floating Button
          • Text
          • Step Control
          • Page Layout
          • Content Card
          • Tabbed Container
        • Data Collection & Forms
          • Form
          • Input Field Types
          • JSON Schema Form
          • Dropdown
          • Select & MultiSelect components
          • Rating
          • Checkbox
          • Switch
          • Toggle Button
          • Radio
        • Meeting & Collaboration
          • Avatar & Avatar Group
          • Comment
        • Project Management
          • Kanban
          • Gantt Chart
        • Calendar & Scheduling
          • Calendar
          • Date & Date Range
          • Time & Time Range
        • Document & File Management
          • File upload
          • Transfer
        • Item & Signature Handling
          • QRCode
          • Scanner
        • Multimedia & Animation
          • Image
          • Lottie Animation
          • Image Carousel
          • Video
          • Audio
          • Image Editor
          • Color Picker
        • Integration & Extension
        • Legacy & Deprecated
      • Option lists
      • Date handling
      • Use Markdown
    • App Interaction
      • Event handlers
    • Themes & Styling
      • Design an efficient and user-friendly form
      • Customize Styles
      • Component Styling Possibilities
    • Video Calls in Lowcoder
  • 🚀Connect your Data
    • Data source basics
      • Configure IP allowlists
    • Data sources in Lowcoder
      • APIs as Datasource
        • REST API
        • GraphQL
        • Google Sheets
      • SQL Databases
        • MySQL
        • MariaDB
        • Supabase
          • Supabase PostgreSQL
          • Supabase Assets API
          • Supabase RealTime
          • Supabase OAuth
        • PostgreSQL
        • Microsoft SQL Server
        • Oracle
      • NoSQL Databases
        • MongoDB
        • CouchDB
        • DynamoDB
      • InMemory Databases
        • Redis
      • File Storages
        • S3 File Storage
      • BigData & OLAP
        • Big Query
        • Snowflake
        • ClickHouse
        • Elasticsearch
      • Websocket Datasource
    • Query basics
      • Bind Query Data to Components
      • Query library
  • 🪄Workflows
    • n8n Integration
  • 💫Business Logic in Apps
    • Write JavaScript
      • JavaScript query
      • Temporary state
      • Transformers
      • Data responder
      • Built-in JS functions
  • 🙌Publish Apps
    • Share an App
    • Publish an App
    • Embed an App
      • Embed App in HTML Pages
      • Embed App in WordPress Pages
      • Embed Apps in React
      • Embed Apps in NEXT.JS
      • Native embed SDK
        • Build the SDK from Source
  • 🔥Lowcoder Extension
    • Opensource Contribution
      • Develop UI components for Apps
      • Develop Data Source Plugins
    • Use third-party libraries in Apps
      • Day.js Date handling
      • Import your own JavaScript Library
    • Custom component
    • Lowcoder Open REST API
  • Lowcoder for Enterprise
    • Custom branding
Powered by GitBook
LogoLogo

More to try...

  • Lowcoder Website
  • Free Cloud Platform
  • Github
  • Discord

© Lowcoder Software LTD

On this page
  • 🔄 Switch Component in Lowcoder
  • 🔧 Key Features
  • 🛠 Configuration Options
  • ⚙️ Integration Tips
  • Component Playground
  • Component Auto-Docs
  • 📌 Use Cases

Was this helpful?

  1. Build Applications
  2. App Editor
  3. Visual Components
  4. Data Collection & Forms

Switch

PreviousCheckboxNextToggle Button

Last updated 1 month ago

Was this helpful?

🔄 Switch Component in Lowcoder

The Switch component in Lowcoder provides a user-friendly toggle interface, enabling users to switch between two states, such as "on" and "off" or "enabled" and "disabled." This component is ideal for settings, preferences, and binary choices within applications.

🔧 Key Features

  • Binary Toggle: Offers a simple interface for toggling between two states.

  • Customizable Labels: Allows setting custom labels for both "on" and "off" states to enhance clarity.

  • Dynamic Binding: Supports binding to variables or data sources for real-time state management.

  • Event Handling: Triggers actions based on state changes, facilitating interactive application behavior.

  • Styling Options: Provides customisation of appearance to align with application design.

🛠 Configuration Options

  • Default State: Set the initial state of the switch (on/off) upon component load.

  • Disabled State: Disable the switch to prevent user interaction when necessary.

  • Labels: Define custom text labels for both states to provide context.

  • Styling: Customize dimensions, colors, and other visual aspects to match your application's theme.

  • Event Handlers: Define actions to be executed upon state changes, such as updating data or triggering other components.

⚙️ Integration Tips

  • Data Binding: Use Lowcoder's data binding syntax ({{ }}) to connect the switch state to variables or data sources.

  • Event Handling: Implement event handlers to perform actions when the switch state changes, such as updating a database or triggering notifications.

  • Combining with Other Components: Integrate the Switch component with forms, settings panels, or other interactive elements to enhance user experience.

Component Playground

On Component Playground, you can interact with the Switch component and explore it's Properties, Events and Methods. Play with different Styling properties to see the effect on the Switch component.

Component Auto-Docs

In the Auto-Docs of Switch component, we have shown how to use different properties of the Switch component. It also includes the Styling properties of the Switch component.

Properties of the Switch component

These properties are accessible in {{ }} notations, as well as in JavaScript Queries.

Property Name
Type
Description

value

Boolean

Returns True or False based on whether the Switch component is On or not

disabled

Boolean

Returns True or False based on whether the Switch component is disabled or not

hidden

Boolean

Returns True or False based on whether the Switch component is hidden or not

Events

Events give you the ability to trigger further actions (with Event-Handlers).

Event Name
Description

Change

Triggers, when anything Changes on the Switch component

On

Tiggers, when Switch component is Turned On.

Off

Tiggers, when Switch component is Turned Off.

Methods

You have the capability to engage with components via their respective methods, which can be accessed by their designated names within any segment where JavaScript is utilized. Additionally, these components can be activated through the 'Control Component' action, which is triggered in response to specific events.

setValue() :

switch1.setValue() method sets the Switch component's Value property, which gets shown in the Switch component.

switch1.setValue(0);

clearValue() :

switch1.clearValue() clears the Switch component's Value property and empties the value from the Switch component.

switch1.clearValue();

resetValue() :

switch1.resetValue() method resets the Switch component's value property to the default value of the Switch component.

switch1.resetValue(1);

setDefaultValue() :

switch1.setDefaultValue() method sets the Switch component's Default value, which gets shown in the Switch component as default.

switch1.setDefaultValue(1);

clearDefaultValue() :

switch1.clearDefaultValue() clears the Switch component's Default value and empties the value from the Switch component.

switch1.clearDefaultValue();

resetDefaultValue() :

switch1.resetDefaultValue() method resets the Switch component's Default value to the default value of the Switch component.

switch1.resetDefaultValue();

📌 Use Cases

  • Feature Toggles: Allow users to enable or disable specific features within the application.

  • Preference Settings: Enable users to set preferences, such as dark mode or notifications.

  • Access Controls: Manage user access to certain functionalities or sections of the application.

  • Form Inputs: Collect binary responses in forms or surveys.

✨
Lowcoder | rapid App & VideoMeeting builder for everyone.
Lowcoder | rapid App & VideoMeeting builder for everyone.