---
title: "Toggle switch styling reference"
source: https://support.storeconnect.com/articles/pos-toggle-switch-styling-reference
type: article
format: markdown
site: StoreConnect Support — product and developer documentation for StoreConnect
site_index: https://storeconnect.com/llms.txt
docs_index: https://support.storeconnect.com/llms.txt
note: Append .md to any page or article URL on this site to get its Markdown form.
---
# Toggle switch styling reference

Toggle switches are the on/off switches at the end of a row in the POS **Hardware** settings, such as the **On-screen number pad** setting. Operators tap a toggle switch to turn a setting on or off, and the round knob slides to the right when the setting is on. You can change the fill and border of the toggle switch track and the fill and border of the knob. Follow the [POS styling API](pos-styling-api#rules) rules when you style toggle switches.

## Where a toggle switch appears

Toggle switches appear in these **Hardware** settings:

- The [**On-screen number pad**](pos-hardware-setup#on-screen-number-pad) setting
- The [**Connect cash drawer**](cash-drawers) setting on a printer
- The payment types that open the cash drawer, under **Cash drawer triggers**

## Parts

| Part | What it is | Available from |
| --- | --- | --- |
| `toggle-switch-root` | The whole switch: the rounded track, with the fill and border, that the thumb slides along. | v22.0.19 |
| `toggle-switch-thumb` | The round knob inside the track, at the left when the switch is off and at the right when it's on. | v22.0.19 |

The **Available from** column shows the first release that carries the name.

## Attributes

Narrow `toggle-switch-root` by this, inside `:where()`, to style a switch that's on or one that's off.

| Attribute | Values | Default | Available from |
| --- | --- | --- | --- |
| `data-checked` | `true`, `false` | `false` | v22.0.19 |

- `true`: the setting is on. The track takes the primary color and the thumb sits at the right.
- `false`: the setting is off. The track is light gray and the thumb sits at the left.

## Component properties

None yet. Style the parts directly.

## Examples

Each example is tested against the POS on every change.

**"Give the switches that are on our brand color."** The thumb of a switch that's on has a border in the primary color, so set the thumb border to the brand color as well:

```css

[part~='toggle-switch-root']:where([data-checked='true']) {
  background-color: #0b5394;
  border-color: #0b5394;
}

[part~='toggle-switch-root']:where([data-checked='true']) [part~='toggle-switch-thumb'] {
  border-color: #0b5394;
}
```

**"Give the switches that are off a darker track."**

```css

[part~='toggle-switch-root']:where([data-checked='false']) {
  background-color: #c4c9d0;
}
```

**"Make the thumb a warmer white."**

```css

[part~='toggle-switch-thumb'] {
  background-color: #fffaf0;
}
```

**"Drop the switches' border."**

```css

[part~='toggle-switch-root'] {
  border-color: transparent;
}
```

## What can't be styled yet

- One switch on its own, such as the on-screen number pad's, since no switch has a name yet
- A switch while it's hovered, apart from the other states: a fill you set on a switch that's off also replaces the darker fill it takes while hovered
- A switch that can't be changed, since no screen draws one
- The colors of a switch through the [POS design tokens](pos-design-tokens-reference): the track and thumb use fixed colors, apart from the primary color of a switch that's on

## Retired

None yet.

---

## Follow StoreConnect

- [Email Newsletter](https://storeconnect.com/c/lp-newsletter)
- [LinkedIn Newsletter](https://www.linkedin.com/build-relation/newsletter-follow?entityUrn=7444956928444862464)
- [YouTube](https://www.youtube.com/channel/UCngKdP2x8l1wcbAKW3tvU8g)
- [LinkedIn](https://www.linkedin.com/company/storeconnect)
- [X / Twitter](https://x.com/storeconnecthq)

## Popular Links

- [Partners](https://storeconnect.com/partners)
- [Become a Partner](https://storeconnect.com/become-a-partner)
- [News](https://storeconnect.com/articles/news)
- [Events](https://storeconnect.com/articles/events)
- [Feature Comparison](https://storeconnect.com/how-we-compare)
- [Download a free trial](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FMkeKUAT)
- [Book a Demo](https://storeconnect.com/contact)

## Documentation

- [Help documentation](https://support.storeconnect.com/help-documentation)
- [AI agents](https://support.storeconnect.com/ai)
- [Videos & tutorials](https://support.storeconnect.com/videos-tutorials)
- [Developer reference](https://support.storeconnect.com/developer-reference)
- [Release notes](https://support.storeconnect.com/release-notes)
- [Troubleshooting](https://support.storeconnect.com/troubleshooting)
- [Trust Center](https://trust.getstoreconnect.com/)
- [Status Page](https://status.storeconnect.com/)

## Contact

- info@getstoreconnect.com
- US +1 415 745 3230
- AUS +61 2 8365 2308

100 S Ashley Dr, Suite 600-2461
Tampa FL 33602-600 USA

Level 22, Sydney Place
180 George Street
Sydney, NSW, 2000, AUS

## Machine-readable

- [Site index for agents](https://storeconnect.com/llms.txt): curated map of the StoreConnect site in llms.txt format
- [Documentation index for agents](https://support.storeconnect.com/llms.txt): full technical and product documentation map

Every page and article on this site has a Markdown rendering: append `.md` to its URL.

Continue in Markdown: [Help documentation](https://support.storeconnect.com/help-documentation.md) · [Developer reference](https://support.storeconnect.com/developer-reference.md) · [Videos & tutorials](https://support.storeconnect.com/videos-tutorials.md) · [Release notes](https://support.storeconnect.com/release-notes.md)

---

StoreConnect Support — https://support.storeconnect.com/articles/pos-toggle-switch-styling-reference