> From the [Strife developer docs](https://strife.app/docs/reference/field-reference/fields.slug). Every page is listed in [llms.txt](https://strife.app/docs/llms.txt).

# fields.slug()

URL slug input, with locale-suffix and uniqueness validation.

URL slug input. Maps to editor `{ name: 'str-input', type: 'slug' }`. In Studio it is a plain text input: the value is stored as typed. Only the built-in `slug` property builds the page's address, and a field stored under the name `slug` replaces Studio's built-in Slug field.

## Example

```ts
fields.slug({
  label: 'Slug',
  placeholder: 'my-page',
})
```

## Options

| Option         | Type                                    | Required | Description                                                                            |
| -------------- | --------------------------------------- | -------- | -------------------------------------------------------------------------------------- |
| `label`        | `string`                                | Yes      | Label shown to editors in Strife Studio.                                               |
| `localizable`  | `boolean`                               | No       | When `true`, output is `Record<string, string>` instead of `string`. See caveat below. |
| `propertyName` | `string`                                | No       | Override the stored property name.                                                     |
| `placeholder`  | `string \| null`                        | No       | Hint text shown in the empty input.                                                    |

> [!NOTE]
> In single-locale teams, `localizable: true` slugs are stored as plain strings server-side regardless of the DSL setting — the server normalizes at the read boundary. The DSL surface is identical either way; this only matters if you're inspecting raw stored documents.

## Output type

`string`, or `Record<string, string>` when `localizable: true`.

## See also

* [Slug](https://strife.app/docs/reference/fields/slug.md): the same editor, documented from the Strife Studio UI side.
