# kyleduo/switchbutton

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/kyleduo-switchbutton).**

4,746 stars · 865 forks · Java

## Links

- GitHub: https://github.com/kyleduo/SwitchButton
- awesome-repositories: https://awesome-repositories.com/repository/kyleduo-switchbutton.md

## Topics

`android` `switchbutton` `widget`

## Description

SwitchButton is a customizable toggle switch widget for creating animated on and off switches with configurable labels and colors. It serves as an interactive form input that allows users to switch between two opposing options using a state-driven component.

The widget is designed to be gesture-aware, capturing horizontal swipe movements to trigger state changes while allowing vertical scroll events to pass through to the parent container.

The component supports the definition of custom colors, dimensions, and corner radii for both the toggle thumb and background track. It includes capabilities for managing toggle states, configuring label text, and adjusting animation speeds.

## Tags

### DevOps & Infrastructure

- [Toggle Switches](https://awesome-repositories.com/f/devops-infrastructure/cloud-infrastructure/cloud-computing-serverless/backend-as-a-service/toggle-switches.md) — Provides a customizable toggle switch widget for binary state selection. ([source](https://github.com/kyleduo/switchbutton#readme))

### Development Tools & Productivity

- [UI State Toggles](https://awesome-repositories.com/f/development-tools-productivity/package-managers/dependency/optional-dependency-managers/feature-toggles/windows-a-b-feature-toggle-managers/ui-state-toggles.md) — Manages the transition between checked and unchecked visual states programmatically or via interaction. ([source](https://github.com/kyleduo/switchbutton#readme))

### User Interface & Experience

- [Toggle Switches](https://awesome-repositories.com/f/user-interface-experience/form-input-components/toggle-switches.md) — Offers detailed styling options for colors, dimensions, and corner radii of the toggle components. ([source](https://github.com/kyleduo/switchbutton#readme))
- [Gesture-Based UI Components](https://awesome-repositories.com/f/user-interface-experience/gesture-based-ui-components.md) — Provides a UI component that reacts to horizontal gesture coordinates to drive its visual state.
- [Gesture Interference Prevention](https://awesome-repositories.com/f/user-interface-experience/navigation-scrolling-tools/scroll-interference-prevention/gesture-interference-prevention.md) — Prevents default page scrolling while the user is performing a horizontal swipe to toggle the switch.
- [Switch Widgets](https://awesome-repositories.com/f/user-interface-experience/switch-widgets.md) — A reusable, styled switch widget for binary boolean input.
- [Swipe-to-Scroll Handlers](https://awesome-repositories.com/f/user-interface-experience/touch-gesture-handlers/swipe-to-scroll-handlers.md) — Handles touch events to distinguish between horizontal toggling swipes and vertical page scrolling. ([source](https://github.com/kyleduo/switchbutton#readme))
- [State-Driven Animations](https://awesome-repositories.com/f/user-interface-experience/ui-animations/state-driven-animations.md) — Uses interpolation to animate position and color changes based on the binary toggle state.
- [Component Style Mappings](https://awesome-repositories.com/f/user-interface-experience/component-style-mappings.md) — Translates configuration properties into visual styles for the switch thumb and background track.
- [Percentage-Based Position Calculators](https://awesome-repositories.com/f/user-interface-experience/coordinate-based-position-calculators/percentage-based-position-calculators.md) — Calculates the horizontal position of the toggle thumb as a percentage of the container width.
- [Custom Widget Implementation](https://awesome-repositories.com/f/user-interface-experience/custom-widget-frameworks/custom-widget-implementation.md) — Implements custom layout and rendering logic for a specialized animated toggle switch.
- [Mobile UI Styling](https://awesome-repositories.com/f/user-interface-experience/mobile-ui-styling.md) — Implements a modern, gesture-responsive mobile design for toggle switches.
- [Styling Property Mappings](https://awesome-repositories.com/f/user-interface-experience/styling-property-mappings.md) — Associates configuration parameters with specific visual styling properties for the toggle widget.

### Part of an Awesome List

- [Widgets and Controls](https://awesome-repositories.com/f/awesome-lists/devtools/widgets-and-controls.md) — Customizable switch button with Material styling.
