---
url: /api/packages/core/src/functions/toKebab.md
---
[pantoken-root](../../../../index.md) / [packages/core/src](../index.md) / 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"
```
