Skip to content

pantoken-root / packages/core/src / toKebab

Function: toKebab() ​

toKebab(str): string

Beta

Convert a CamelCase / spaced string to kebab-case.

Parameters ​

str ​

string

Returns ​

string

Example ​

ts
import { toKebab } from "@pantoken/core";

toKebab("baseButton");   // → "base-button"
toKebab("Font Family");  // → "font-family"
toKebab("rebrandLight"); // → "rebrand-light"