formatContent & truncate
Text truncate and content formatting helpers.
792 B
•Updated on September 3, 2026
Installation
Bash
pnpm dlx shadcn@latest add @spaceui/hooks-utils-format-contentUsage
Code
import { slugifyHeadline } from '@/utils/format-content'
slugifyHeadline('Getting Started with React!') // => "getting-started-with-react"API Reference
Parameters / Props
| Parameter | Type | Default | Description |
|---|---|---|---|
text | string | required | Input text. |
maxLength | number | required | Max length. |
Return Value
| Return Type | Description |
|---|---|
string | Truncated string. |