martin-ro/filament-charcount-field
最新稳定版本:0.1.5
Composer 安装命令:
composer require martin-ro/filament-charcount-field
包简介
Filament fields with character count.
README 文档
README
Character counted TextInput & Textarea for Filament.
This package provides a TextInput and Textarea component for Filament Admin and Forms with a character count display.
TextInput
use MartinRo\FilamentCharcountField\Components\CharcountedTextInput; CharcountedTextInput::make('title') ->minCharacters(5) ->maxCharacters(10),
Textarea
use MartinRo\FilamentCharcountField\Components\CharcountedTextarea; CharcountedTextarea::make('title') ->minCharacters(5) ->maxCharacters(10),
Here's an example of how the components looks like:

Demo:
Installation
First, install the packages:
composer require martin-ro/filament-charcount-field
Add the components to a Filament resource form:
<?php namespace App\Filament\Resources; // ... use MartinRo\FilamentCharcountField\Components\CharcountedTextInput; use MartinRo\FilamentCharcountField\Components\CharcountedTextarea; class PostResource extends Resource { // ... public static function form(Form $form): Form { return $form->schema([ // ... // TextInput CharcountedTextInput::make('title') ->label('Title') ->hintIcon('heroicon-o-code') ->hint('Title tag in header') ->helperText('While Google does not specify a length for title tags, usually the first 50–60 characters are displayed.') ->minCharacters(50) ->maxCharacters(60), // Textarea CharcountedTextarea::make('description') ->label('Description') ->rows(4) ->hintIcon('heroicon-o-code') ->hint('Meta description tag in header') ->helperText('Meta descriptions can technically be any length, but Google generally truncates snippets to ~155-160 characters.') ->minCharacters(155) ->maxCharacters(160), // .. ]); } // ... }
统计信息
- 总下载量: 4.49k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-04-10

