Getting Started
Introduction
Development
Getting Started
Local Portless Workspace
Agent Skills
Release Workflow
Hooks
Overview
Browser
useCopyToClipboard
Effects
useKeyBinding
State
useToggle
Ui
Overview
Components
Avatar
Button
Card
Chart
DropdownMenu
Kbd
Popover
Select
Separator
Skeleton
Slider
Table
Tooltip
Typography
Data Display
DataGrid
Feedback
Command
Dialog
Forms
Checkbox
Field
Input
Label
RadioGroup
Utils
Overview
Datetime
formatTimestamp
Number
formatCents
String
toCamelCase
toSlug
toTitleCase
Validators
isEmpty
  1. Home
  2. Utils

Utils

Explore utils docs by category and open each page for usage and source references.

Categories

Datetime

1 page

Number

1 page

String

3 pages

Validators

1 page

All pages

formatTimestamp

Formats a timestamp into a localized date/time string. By default, formatting uses the user's locale and timezone.

formatCents

Formats an integer cent value as a locale-formatted number string. Returns a plain number string (e.g. `"12.50"`). Currency symbol rendering is intentionally left to the caller so this function remains framework-agnostic and testable in isolation.

toCamelCase

Converts text into camelCase using spaces, underscores, and hyphens as separators. The function lowercases all tokens, removes extra separators, and joins subsequent tokens with an uppercase leading character.

toSlug

Converts a string into a URL-friendly slug. The function lowercases text, removes diacritics, normalizes separators, strips unsupported characters, and joins words with hyphens.

toTitleCase

Converts text to title case using spaces, underscores, and hyphens as word separators. The function normalizes separators into single spaces, removes extra separators, and transforms each token so the first character is uppercase while the rest are lowercase.

isEmpty

Checks whether a value is empty. Empty values include `null`, `undefined`, empty strings (after trimming), empty arrays, empty maps, empty sets, and plain objects with no own keys.

On This Page
  • Categories
  • All pages