PHPackages                             mziraki/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. mziraki/nova-toggle

Abandoned → [davidpiesse/nova-toggle](/?search=davidpiesse%2Fnova-toggle)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

mziraki/nova-toggle
===================

A Boolean Toggle Switch Field

0.0.7(5y ago)01.2kMITVuePHP &gt;=7.1.0

Since Aug 26Pushed 5y agoCompare

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

READMEChangelogDependenciesVersions (17)Used By (0)

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

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.2% 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 ~133 days

Recently: every ~192 days

Total

7

Last Release

2019d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6510195?v=4)[Mahdi Ziraki](/maintainers/mziraki)[@mziraki](https://github.com/mziraki)

---

Top Contributors

[![davidpiesse](https://avatars.githubusercontent.com/u/800650?v=4)](https://github.com/davidpiesse "davidpiesse (15 commits)")[![daguilarm](https://avatars.githubusercontent.com/u/2663941?v=4)](https://github.com/daguilarm "daguilarm (1 commits)")[![mziraki](https://avatars.githubusercontent.com/u/6510195?v=4)](https://github.com/mziraki "mziraki (1 commits)")

---

Tags

laravelnova

### Embed Badge

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

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

###  Alternatives

[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

3403.5M7](/packages/optimistdigital-nova-multiselect-field)[digital-creative/conditional-container

Provides an easy way to conditionally show and hide fields in your Nova resources.

116593.8k4](/packages/digital-creative-conditional-container)[genealabs/laravel-overridable-model

Provide a uniform method of allowing models to be overridden in Laravel.

92398.0k2](/packages/genealabs-laravel-overridable-model)[inspheric/nova-defaultable

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

51174.8k1](/packages/inspheric-nova-defaultable)[murdercode/nova4-tinymce-editor

Boost your Laravel Nova with the TinyMCE editor.

17165.2k](/packages/murdercode-nova4-tinymce-editor)[yieldstudio/nova-google-autocomplete

A Laravel Nova Google autocomplete field.

12218.4k](/packages/yieldstudio-nova-google-autocomplete)

PHPackages © 2026

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