PHPackages                             lednerb/nova-text-copy-field - 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. lednerb/nova-text-copy-field

ActiveLibrary

lednerb/nova-text-copy-field
============================

Laravel Nova text field with click to copy support

v1.6.0(4y ago)37.8kMITVuePHP &gt;=7.1.0

Since Oct 9Pushed 4y agoCompare

[ Source](https://github.com/Lednerb/nova-text-copy-field)[ Packagist](https://packagist.org/packages/lednerb/nova-text-copy-field)[ Docs](https://github.com/lednerb/nova-text-copy-field)[ RSS](/packages/lednerb-nova-text-copy-field/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (13)Used By (0)

Nova Text Copy Field
====================

[](#nova-text-copy-field)

[![Packagist Version](https://camo.githubusercontent.com/e228a89040d4333675ada2bf599a32cd5c1ae0863914935f64d9be088be3454f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c65646e6572622f6e6f76612d746578742d636f70792d6669656c642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lednerb/nova-text-copy-field)[![Packagist Downloads](https://camo.githubusercontent.com/7726bb8836c8ad894a3d7df9c9b33c9278be1275a529958b41c1239328c869ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c65646e6572622f6e6f76612d746578742d636f70792d6669656c642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lednerb/nova-text-copy-field)

This repo is a fork from the original [`sixlive/nova-text-copy-field`](https://github.com/sixlive/nova-text-copy-field) one that implements some additional features and fixes and is fully compatible to the original code:

- Support for `readonly` fields
- Don't show the copy button on empty or null values
- Changed icons to heroicons to match Nova styling

---

A Laravel Nova text field with click to copy support. This field behaves just like a text field but adds the ability to copy the field value to your clipboard with just a click.

This package can also be found on [Nova Packages](https://novapackages.com/packages/lednerb/nova-text-copy-field).

[![animated screenshot](.docs/animated.gif)](.docs/animated.gif)

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

[](#installation)

```
> composer require lednerb/nova-text-copy-field
```

Usage
-----

[](#usage)

Add the field to a resource.

```
use Sixlive\TextCopy\TextCopy;

public function fields(Request $request)
{
    return [
        TextCopy::make('Example Copy Field', 'example_copy_field'),
    ];
}
```

### Truncating long strings

[](#truncating-long-strings)

In some cases you may want to truncate the display of a fields value but allow still copy the full value. You can use the `truncate()` method to accomplish this.

```
TextCopy::make('Some Long Field')
    ->truncate(100)
```

### Masking the field value

[](#masking-the-field-value)

This works great for secrets like API Keys.

```
TextCopy::make('Some Secret String', 'some_secret_string')
    ->mask('❌') // default '*'
    ->truncate(5)
```

### Copy button title

[](#copy-button-title)

The title of the copy button defaults to the field name prefixed with 'Copy'. For example, `TextCopy::make('Some Field', 'some_field')` the button title will be "Copy Some Field".

If you would like to manually set the title you can use the `copyButtonTitle()` method.

```
TextCopy::make('Some Field', 'some_field')
    ->copyButtonTitle('Some alternative title')
```

### Alternative copy value

[](#alternative-copy-value)

You can choose to mutate and that is copied to the users clipboard. You can either pass a value or a Closure.

```
TextCopy::make('Some Secret String', 'some_long_string')
    ->copyValue(function ($value) {
        return substr($value, -6);
    })
```

or

```
TextCopy::make('Some Secret String', 'some_long_string')
    ->copyValue('some fixed copy value')
```

### Only displaying the button on hover

[](#only-displaying-the-button-on-hover)

```
TextCopy::make('Some Secret String', 'some_long_string')
    ->showButtonOnlyOnHover()
```

Screenshots
-----------

[](#screenshots)

### Default State

[](#default-state)

[![default](.docs/default.png)](.docs/default.png)[![default](.docs/index.png)](.docs/index.png)

### Success State

[](#success-state)

When the field value has been successfully copied to the user's clipboard. [![success](.docs/success.png)](.docs/success.png)

### Error State

[](#error-state)

When there is an error adding the field value to the user's clipboard. [![error](.docs/error.png)](.docs/error.png)

### Truncated Display Value

[](#truncated-display-value)

[![truncated display](.docs/truncated-screenshot.png)](.docs/truncated-screenshot.png)

### Masked Display Value

[](#masked-display-value)

[![masked display](.docs/masked-screenshot.png)](.docs/masked-screenshot.png)

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Code Style
----------

[](#code-style)

StyleCI will apply the [Laravel preset](https://docs.styleci.io/presets#laravel).

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [TJ Miller](https://github.com/sixlive)
- [Sascha Brendel](https://github.com/Lednerb)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 76.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 ~140 days

Recently: every ~301 days

Total

10

Last Release

1505d ago

Major Versions

v0.2.0 → v1.0.02018-10-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/877ffa580db2a303f37db4d218e52ffec0dfb61161ac3a1e56384dd4a5a5a2dc?d=identicon)[Lednerb](/maintainers/Lednerb)

---

Top Contributors

[![sixlive](https://avatars.githubusercontent.com/u/5108034?v=4)](https://github.com/sixlive "sixlive (30 commits)")[![Lednerb](https://avatars.githubusercontent.com/u/2056876?v=4)](https://github.com/Lednerb "Lednerb (5 commits)")[![everestmx](https://avatars.githubusercontent.com/u/5403326?v=4)](https://github.com/everestmx "everestmx (2 commits)")[![mattdfloyd](https://avatars.githubusercontent.com/u/185187?v=4)](https://github.com/mattdfloyd "mattdfloyd (1 commits)")[![tnorthcutt](https://avatars.githubusercontent.com/u/796639?v=4)](https://github.com/tnorthcutt "tnorthcutt (1 commits)")

---

Tags

laravelnova

### Embed Badge

![Health badge](/badges/lednerb-nova-text-copy-field/health.svg)

```
[![Health](https://phpackages.com/badges/lednerb-nova-text-copy-field/health.svg)](https://phpackages.com/packages/lednerb-nova-text-copy-field)
```

###  Alternatives

[optimistdigital/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2872.1M6](/packages/optimistdigital-nova-sortable)[outl1ne/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2861.8M9](/packages/outl1ne-nova-sortable)[laravel/nova-log-viewer

A Laravel Nova tool for viewing your application logs.

136301.3k1](/packages/laravel-nova-log-viewer)[stepanenko3/nova-command-runner

Laravel Nova tool for running Artisan and bash(shell) commands.

36983.0k](/packages/stepanenko3-nova-command-runner)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57215.9k](/packages/sbine-route-viewer)[dniccum/nova-documentation

A Laravel Nova tool that allows you to add markdown-based documentation to your administrator's dashboard.

37116.4k](/packages/dniccum-nova-documentation)

PHPackages © 2026

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