Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brob/sanity-plugin-string-limiter
A simple Sanity.io custom string input to display a character count for string fields that have a Max() validation rule.
https://github.com/brob/sanity-plugin-string-limiter
Last synced: 7 days ago
JSON representation
A simple Sanity.io custom string input to display a character count for string fields that have a Max() validation rule.
- Host: GitHub
- URL: https://github.com/brob/sanity-plugin-string-limiter
- Owner: brob
- License: mit
- Created: 2021-05-04T14:32:24.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T17:53:11.000Z (about 1 year ago)
- Last Synced: 2024-11-07T00:29:16.361Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sanity-plugin-string-limiter
A custom input component to show max length validation in a UI for editors
## Installation
```
sanity install string-limiter
```## Usage
After it's installed, you can use the custom input to replace any input of type `string`. It requires a validation rule to set the max limit for the input.
```javascript
export default {
name: 'aDocument',
title: 'A Document',
type: 'document',
fields: [
{
name: 'title',
title: 'Title',
type: 'limitedString', // Uses the custom input
validation: Rule => Rule.max(50) // This will set the max range
}
]
}
```## License
MIT © Bryan Robinson
See LICENSE