---
type: doc
title: Toggle
description: Native Liquid toggle 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/toggle.liquid"
<button
  type='button'
  data-slot='toggle'
  data-variant='outline'
  aria-label='Favorite'
>
  <svg
    class='icon'
    data-slot='icon'
    viewBox='0 0 24 24'
    fill='none'
    stroke='currentColor'
    stroke-width='2'
    stroke-linecap='round'
    stroke-linejoin='round'
    aria-hidden='true'
    focusable='false'
  >
    <path d='M19 14c1.5-1.5 3-3.2 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.8 0-3 .5-4.5 2-1.5-1.5-2.7-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4 3 5.5l7 7Z'/>
  </svg>
</button>
```

## Installation

```bash
npx shadcn@latest add https://ui.full.dev/r/liquid/toggle.json https://ui.full.dev/r/liquid/icon.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-triggers' %}
{% render 'ui-runtime' %}
{% render 'ui-toggle' %}
{% render 'ui-icon' %}
```

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

`toggle`.

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

## Variants

`outline`.

## Sizes

`lg`, `sm`.

## Install what this page shows

```bash
npx shadcn@latest add https://ui.full.dev/r/liquid/toggle.json https://ui.full.dev/r/liquid/icon.json
```
