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

# fields.slider()

Numeric range slider. Never localizable.

Numeric range slider. Maps to editor `{ name: 'str-slider', type: 'slider' }`. Output is a plain `number`; range bounds, step and affordances are configured via the options below.

## Example

```ts
fields.slider({
  label: 'Opacity',
  min: 0,
  max: 1,
  step: 0.05,
})
```

## Options

| Option         | Type             | Required | Default | Description                                                |
| -------------- | ---------------- | -------- | ------- | ---------------------------------------------------------- |
| `label`        | `string`         | Yes      | —       | Label shown to editors in Strife Studio.                   |
| `propertyName` | `string`         | No       | —       | Override the stored property name.                         |
| `min`          | `number \| null` | No       | `0`     | Lower bound of the range.                                  |
| `max`          | `number \| null` | No       | `100`   | Upper bound of the range.                                  |
| `step`         | `number \| null` | No       | `1`     | Increment step when dragging.                              |
| `defaultValue` | `number`         | No       | —       | The value an empty field shows in Studio. It is never stored: until an editor moves the slider, the document has no value, so read the field with the same fallback. Needs `@strifeapp/strife` 2.0.0 or later. |

No `localizable` option.

## Output type

`number`.

## See also

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