Skip to main content

Introduction

The toggle column renders a toggle button for inline boolean editing:

Basic usage

The toggle column provides a visual switch that updates the database when toggled:

Customizing colors

You can customize the colors for the on and off states:
string | array | Closure
default:"'primary' for on, 'gray' for off"
The color when toggled on or off.

Customizing icons

Customize the icons for the on and off states:
string | BackedEnum | Htmlable | Closure
The icon to display when toggled on or off.

Validation

By default, the toggle column validates the input as a boolean:

Lifecycle hooks

Execute code before and after the toggle state is updated:

Example: Logging changes

Disabling the toggle

You can disable the toggle conditionally:

Tooltips

Add tooltips to provide context: