> ## Documentation Index
> Fetch the complete documentation index at: https://api.fanvue.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# SwitchField

> A labelled switch field with optional helper text and info tooltip.

```tsx theme={null}
import { SwitchField } from "@fanvue/ui";
import type { SwitchFieldOrientation, SwitchFieldProps } from "@fanvue/ui";
```

## Examples

## Default

<Frame>
  <iframe src={"https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-switchfield--default&viewMode=story&shortcuts=false&singleStory=true&globals=theme:light"} width="100%" height="240" style={{border: "none", borderRadius: "8px"}} loading="lazy" title="SwitchField — Default" />
</Frame>

```tsx theme={null}
import { SwitchField } from "@fanvue/ui";

<SwitchField label="Toggle" helperText="Helper" />
```

## Disabled

<Frame>
  <iframe src={"https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-switchfield--disabled&viewMode=story&shortcuts=false&singleStory=true&globals=theme:light"} width="100%" height="240" style={{border: "none", borderRadius: "8px"}} loading="lazy" title="SwitchField — Disabled" />
</Frame>

```tsx theme={null}
import { SwitchField } from "@fanvue/ui";

<SwitchField label="Toggle" helperText="Helper" disabled />
```

## With Info

<Frame>
  <iframe src={"https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-switchfield--with-info&viewMode=story&shortcuts=false&singleStory=true&globals=theme:light"} width="100%" height="240" style={{border: "none", borderRadius: "8px"}} loading="lazy" title="SwitchField — With Info" />
</Frame>

```tsx theme={null}
import { SwitchField } from "@fanvue/ui";

<SwitchField label="Toggle" helperText="Helper" infoText="Info text" />
```

## All Variants

<Frame>
  <iframe src={"https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-switchfield--all-variants&viewMode=story&shortcuts=false&singleStory=true&globals=theme:light"} width="100%" height="240" style={{border: "none", borderRadius: "8px"}} loading="lazy" title="SwitchField — All Variants" />
</Frame>

```tsx theme={null}
import { SwitchField } from "@fanvue/ui";

<div className="flex flex-col gap-6">
  <div className="flex flex-col gap-3">
    <span className="typography-body-small-14px-semibold text-content-secondary">
      Default - Right orientation
    </span>
    <SwitchField label="Toggle" helperText="Helper" orientation="right" checked={true} />
  </div>
  <div className="flex flex-col gap-3">
    <span className="typography-body-small-14px-semibold text-content-secondary">
      Default - Left orientation
    </span>
    <SwitchField label="Toggle" helperText="Helper" orientation="left" checked={true} />
  </div>
  <div className="flex flex-col gap-3">
    <span className="typography-body-small-14px-semibold text-content-secondary">
      Small - Right orientation
    </span>
    <SwitchField
      label="Toggle"
      helperText="Helper"
      size="small"
      orientation="right"
      checked={true}
    />
  </div>
  <div className="flex flex-col gap-3">
    <span className="typography-body-small-14px-semibold text-content-secondary">
      Small - Left orientation
    </span>
    <SwitchField
      label="Toggle"
      helperText="Helper"
      size="small"
      orientation="left"
      checked={true}
    />
  </div>
</div>
```

## Disabled Checked

<Frame>
  <iframe src={"https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-switchfield--disabled-checked&viewMode=story&shortcuts=false&singleStory=true&globals=theme:light"} width="100%" height="240" style={{border: "none", borderRadius: "8px"}} loading="lazy" title="SwitchField — Disabled Checked" />
</Frame>

```tsx theme={null}
import { SwitchField } from "@fanvue/ui";

<SwitchField label="Toggle" helperText="Helper" disabled checked />
```

## Props

## SwitchField

A labelled switch field with optional helper text and info tooltip. Composes the `Switch` component with a `<label>` and description.

<ParamField path="className" type="string">
  Additional CSS class name for the outer wrapper.
</ParamField>

<ParamField path="helperText" type="string">
  Descriptive text displayed below the label.
</ParamField>

<ParamField path="infoLabel" type="string" default="More information">
  Accessible label for the info tooltip trigger button. Override for i18n.
</ParamField>

<ParamField path="infoText" type="string">
  Tooltip text shown when hovering the info icon next to the label.
</ParamField>

<ParamField path="label" type="string">
  Label text displayed next to the switch.
</ParamField>

<ParamField path="orientation" type="&#x22;left&#x22; | &#x22;right&#x22;" default="right">
  Side on which the switch is placed relative to the label.
</ParamField>

<ParamField path="size" type="&#x22;small&#x22; | &#x22;default&#x22;" default="default">
  Size variant of the switch and accompanying text.
</ParamField>

## Exported types

Also exported from `@fanvue/ui`: `SwitchFieldOrientation`, `SwitchFieldProps`.

***

**Setup:** [Installation](/docs/ui/installation) · [Theming](/docs/ui/theming)
