---
type: doc
title: Switch
description: Native Liquid switch with readable CSS and shared data-slot parts.
---

> Native Liquid and CSS. Install from `https://ui.full.dev/r/liquid/{name}.json`; see [layout setup](/liquid/docs/installation.md). No Tailwind or consuming build.

```liquid title="liquid/examples/switch.liquid"
<label data-slot='label'>
  <input type='checkbox' data-slot='checkbox' name='updates' value='yes' data-fallback>
  <span data-slot='switch' data-name='updates' data-value='yes' hidden>
    <span data-slot='switch-thumb'></span>
  </span>
  Email me updates
</label>
```

## Installation

```bash
npx shadcn@latest add https://ui.full.dev/r/liquid/switch.json https://ui.full.dev/r/liquid/checkbox.json https://ui.full.dev/r/liquid/field.json
```

Follow the [one-time layout setup](/liquid/docs/installation/). A full `components` install already includes this item.

## Usage

After this install, render these once in the layout head before theme overrides and other modules. The full `ui` hook already includes them. The command also installs the parts used in this example.

```liquid
{% render 'ui-init' %}
{% render 'ui-invalid-controls' %}
{% render 'ui-runtime' %}
{% render 'ui-switch' %}
{% render 'ui-input' %}
{% render 'ui-checkbox' %}
{% render 'ui-field' %}
```

The preview and its Usage tab render the same native Liquid source. Use `data-slot` for parts, `data-variant` for variants and `data-size` for sizes. Keep your store's labels, translations and Shopify data in your theme.

## Parts

`switch`, `switch-thumb`.

[Component source](https://github.com/fulldotdev/ui/tree/main/liquid/components/switch.liquid) · [Theming](/liquid/docs/theming/)

## Sizes

`sm`.

## Install what this page shows

```bash
npx shadcn@latest add https://ui.full.dev/r/liquid/switch.json https://ui.full.dev/r/liquid/checkbox.json https://ui.full.dev/r/liquid/field.json
```
