PHPackages                             davidpiesse/nova-toggle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. davidpiesse/nova-toggle

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

davidpiesse/nova-toggle
=======================

A Boolean Toggle Switch Field

4.0(3y ago)861.1M↓13.9%33[14 PRs](https://github.com/davidpiesse/nova-toggle/pulls)3MITVuePHP ^7.3|^8.0

Since Aug 26Pushed 2y ago2 watchersCompare

[ Source](https://github.com/davidpiesse/nova-toggle)[ Packagist](https://packagist.org/packages/davidpiesse/nova-toggle)[ RSS](/packages/davidpiesse-nova-toggle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)DependenciesVersions (19)Used By (3)

Toggle Field
============

[](#toggle-field)

A drop in replacement for the default Boolean field

[![Toggle In Action](https://camo.githubusercontent.com/f8f274c9dcb1befe0efe395d24dcd98304f65e7d0f31a5aa4e62794ac35ee72a/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f64617669647069657373652f696d6167652f75706c6f61642f76313533353331373236372f323031382d30382d32365f32312e35392e33305f7332627533392e676966)](https://camo.githubusercontent.com/f8f274c9dcb1befe0efe395d24dcd98304f65e7d0f31a5aa4e62794ac35ee72a/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f64617669647069657373652f696d6167652f75706c6f61642f76313533353331373236372f323031382d30382d32365f32312e35392e33305f7332627533392e676966)

Installation
------------

[](#installation)

Same as most other Nova Packages

```
composer require davidpiesse/nova-toggle

```

Usage
-----

[](#usage)

The Toggle has all the same options as the Boolean field so you can set the values to be stored in the Model.

```
use Davidpiesse\NovaToggle\Toggle;
```

```
Toggle::make('Active')
    ->trueValue('On')
    ->falseValue('Off')
```

In addition you can set visual parameters

### Labels

[](#labels)

You can show both, or each state label

```
Toggle::make('Active')
    ->showLabels() //Both labels
    ->showOnlyTrueLabel() //True label only
    ->showOnlyFalseLabel() //False label only
```

To set the text you can use either or both of the following. You must also set the visibility of the labels as described above.

```
Toggle::make('Active')
    ->showLabels()
    ->trueLabel('Tru Dat')
    ->falseLabel('Nah Dawg')
```

The defaults are 'True' and 'False'

### Size

[](#size)

You can set the width and height. Setting the width will auto scale the height, but you can override this with -&gt;height(). Defaults are 60 (px) and 26 (px)

```
Toggle::make('Active')
    ->width(80)
    ->height(45) //To override scaling
```

### Colors

[](#colors)

You can set wither or both of the background colours for the Toggle. By default True is the Nova 'Success Green' \[ var(--success) \] and false is a Grey 60 \[ var(--60) \]

```
Toggle::make('Active')
    ->trueColor('pink')
    ->falseColor('#fcfcfc')
```

### Speed

[](#speed)

You can set the animation speed in ms with

```
Toggle::make('Active')
    ->speed(500)
```

The default is 300ms

### Toggle on index

[](#toggle-on-index)

You can activate the toggle on index as well with

```
Toggle::make('Active')
    ->editableIndex()
```

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity54

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 78.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~165 days

Recently: every ~360 days

Total

10

Last Release

1333d ago

Major Versions

0.0.8 → 4.02022-07-21

PHP version history (2 changes)0.0.1PHP &gt;=7.1.0

4.0PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/9beea64e2348d11d5f96d4138ccfcf393bab92e803faa27437d794c279575d20?d=identicon)[davidpiesse](/maintainers/davidpiesse)

---

Top Contributors

[![davidpiesse](https://avatars.githubusercontent.com/u/800650?v=4)](https://github.com/davidpiesse "davidpiesse (15 commits)")[![bernhardh](https://avatars.githubusercontent.com/u/642292?v=4)](https://github.com/bernhardh "bernhardh (1 commits)")[![bolechen](https://avatars.githubusercontent.com/u/195015?v=4)](https://github.com/bolechen "bolechen (1 commits)")[![daguilarm](https://avatars.githubusercontent.com/u/2663941?v=4)](https://github.com/daguilarm "daguilarm (1 commits)")[![lucidlogic](https://avatars.githubusercontent.com/u/932221?v=4)](https://github.com/lucidlogic "lucidlogic (1 commits)")

---

Tags

booleanfieldlaravelnovatogglelaravelfieldtogglenova

### Embed Badge

![Health badge](/badges/davidpiesse-nova-toggle/health.svg)

```
[![Health](https://phpackages.com/badges/davidpiesse-nova-toggle/health.svg)](https://phpackages.com/packages/davidpiesse-nova-toggle)
```

###  Alternatives

[timothyasp/nova-color-field

A Laravel Nova Color Picker field.

781.6M5](/packages/timothyasp-nova-color-field)[alexwenzel/nova-dependency-container

A Laravel Nova 4 form container for grouping fields that depend on other field values.

461.0M2](/packages/alexwenzel-nova-dependency-container)[simplesquid/nova-enum-field

A Laravel Nova field to add enums to resources.

52391.9k2](/packages/simplesquid-nova-enum-field)[outhebox/nova-hidden-field

A Laravel Nova Hidden field.

33562.2k1](/packages/outhebox-nova-hidden-field)[sietse85/nova-button

(Nova 4+) A Laravel Nova package for adding buttons to your resources.

37347.3k](/packages/sietse85-nova-button)[inspheric/nova-defaultable

Default values for Nova fields when creating resources and running resource actions.

51174.8k1](/packages/inspheric-nova-defaultable)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
