{"title":"Toggle switch styling reference","slug":"pos-toggle-switch-styling-reference","url":"https://support.storeconnect.com/articles/pos-toggle-switch-styling-reference","url_markdown":"https://support.storeconnect.com/articles/pos-toggle-switch-styling-reference.md","subtitle":null,"summary":"Every part and attribute for restyling the POS\u0026#39;s toggle switches with CSS, the on/off switches at the end of a settings row, such as the on-screen number pad setting, with tested examples such as giving the switches that are on a brand color, and the list of what can\u0026#39;t be styled yet.","type":"Developer_Documentation","video_url":"","keywords":"pos toggle switch css, pos switch css, on off switch css, settings toggle css, toggle-switch-root, toggle-switch-thumb, data-checked, pos styling api, pos parts","last_modified":"2026-12-02T03:13:07+0000","body_markdown":"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.\n\n## Where a toggle switch appears\n\nToggle switches appear in these **Hardware** settings:\n\n- The [**On-screen number pad**](pos-hardware-setup#on-screen-number-pad) setting\n- The [**Connect cash drawer**](cash-drawers) setting on a printer\n- The payment types that open the cash drawer, under **Cash drawer triggers**\n\n## Parts\n\n| Part | What it is | Available from |\n| --- | --- | --- |\n| `toggle-switch-root` | The whole switch: the rounded track, with the fill and border, that the thumb slides along. | v22.0.19 |\n| `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 |\n\nThe **Available from** column shows the first release that carries the name.\n\n## Attributes\n\nNarrow `toggle-switch-root` by this, inside `:where()`, to style a switch that's on or one that's off.\n\n| Attribute | Values | Default | Available from |\n| --- | --- | --- | --- |\n| `data-checked` | `true`, `false` | `false` | v22.0.19 |\n\n- `true`: the setting is on. The track takes the primary color and the thumb sits at the right.\n- `false`: the setting is off. The track is light gray and the thumb sits at the left.\n\n## Component properties\n\nNone yet. Style the parts directly.\n\n## Examples\n\nEach example is tested against the POS on every change.\n\n**\"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:\n\n```css\n\n[part~='toggle-switch-root']:where([data-checked='true']) {\n  background-color: #0b5394;\n  border-color: #0b5394;\n}\n\n[part~='toggle-switch-root']:where([data-checked='true']) [part~='toggle-switch-thumb'] {\n  border-color: #0b5394;\n}\n```\n\n**\"Give the switches that are off a darker track.\"**\n\n```css\n\n[part~='toggle-switch-root']:where([data-checked='false']) {\n  background-color: #c4c9d0;\n}\n```\n\n**\"Make the thumb a warmer white.\"**\n\n```css\n\n[part~='toggle-switch-thumb'] {\n  background-color: #fffaf0;\n}\n```\n\n**\"Drop the switches' border.\"**\n\n```css\n\n[part~='toggle-switch-root'] {\n  border-color: transparent;\n}\n```\n\n## What can't be styled yet\n\n- One switch on its own, such as the on-screen number pad's, since no switch has a name yet\n- 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\n- A switch that can't be changed, since no screen draws one\n- 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\n\n## Retired\n\nNone yet."}