PHPackages                             oceanapplications/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. [Templating &amp; Views](/categories/templating)
4. /
5. oceanapplications/nova-toggle

ActiveLibrary[Templating &amp; Views](/categories/templating)

oceanapplications/nova-toggle
=============================

A Laravel Nova field.

1.0.0(3y ago)015MITPHPPHP ^7.3|^8.0

Since Aug 26Pushed 3y agoCompare

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

READMEChangelog (1)DependenciesVersions (14)Used By (0)

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

[](#toggle-field)

A drop in replacement for the default Boolean field

[![Toggle In Action](https://camo.githubusercontent.com/10d793a4b3cd2737c7063bcff1eaeb464804ee11eb1ce0239510407afacfcf87/68747470733a2f2f692e696d6775722e636f6d2f634c42376b64572e676966)](https://camo.githubusercontent.com/10d793a4b3cd2737c7063bcff1eaeb464804ee11eb1ce0239510407afacfcf87/68747470733a2f2f692e696d6775722e636f6d2f634c42376b64572e676966)

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 Oceanapplications\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()
```

### Toggle value on pivot table

[](#toggle-value-on-pivot-table)

Used when many to many relationship returns fields in the pivot table

```
Toggle::make('Active')
    ->inPivot($request->viaResource, $request->viaResourceId),
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 68.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 ~173 days

Recently: every ~338 days

Total

9

Last Release

1426d ago

Major Versions

0.0.8 → 1.0.02022-06-13

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

1.0.0PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/58f943d2f265e822ed311a9c234d1121190cf61c411b57cd49c61410d00c8330?d=identicon)[oceanapplications](/maintainers/oceanapplications)

---

Top Contributors

[![davidpiesse](https://avatars.githubusercontent.com/u/800650?v=4)](https://github.com/davidpiesse "davidpiesse (15 commits)")[![oceanapplications](https://avatars.githubusercontent.com/u/2704923?v=4)](https://github.com/oceanapplications "oceanapplications (2 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)")[![bernhardh](https://avatars.githubusercontent.com/u/642292?v=4)](https://github.com/bernhardh "bernhardh (1 commits)")[![jjjrmy](https://avatars.githubusercontent.com/u/1609800?v=4)](https://github.com/jjjrmy "jjjrmy (1 commits)")[![lucidlogic](https://avatars.githubusercontent.com/u/932221?v=4)](https://github.com/lucidlogic "lucidlogic (1 commits)")

---

Tags

laravelnova

### Embed Badge

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

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

###  Alternatives

[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[outl1ne/nova-multiselect-field

A multiple select field for Laravel Nova.

3402.9M2](/packages/outl1ne-nova-multiselect-field)[emilianotisato/nova-tinymce

This Nova package allow you to use TinyMCE editor for text areas.You can customize the editor options and... you can upload images to your server and put them rigth there on the text without leaving the text editor!

116884.3k4](/packages/emilianotisato-nova-tinymce)[silvanite/novafieldcheckboxes

A Laravel Nova field to display a number of multi-select options using checkboxes.

70846.9k1](/packages/silvanite-novafieldcheckboxes)[waynestate/nova-ckeditor4-field

This nova package allows you to use CKEditor 4 for text areas.

62739.1k8](/packages/waynestate-nova-ckeditor4-field)[saumini/ellipsis-textarea

A Laravel Nova textarea field with ellipsis support

12146.9k](/packages/saumini-ellipsis-textarea)

PHPackages © 2026

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