# Settings Toggle List

> A settings panel of rows with a title, a short description and a switch, where the whole row is clickable.

- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: settings, preferences, toggle, switch, list, notifications
- Live preview: https://copy-css.com/snippets/settings-toggle-list
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<fieldset class="settings-list">
  <legend>Notifications</legend>
  <label>
    <span><strong>Comments</strong>When someone replies to you</span>
    <input type="checkbox" role="switch" checked>
  </label>
  <label>
    <span><strong>Mentions</strong>When someone tags you</span>
    <input type="checkbox" role="switch">
  </label>
  <label>
    <span><strong>Weekly digest</strong>A summary every Monday</span>
    <input type="checkbox" role="switch" checked>
  </label>
</fieldset>
```

## CSS

```css
.settings-list {
  width: 100%;
  max-width: 300px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  background: #fff;
  color: #18181b;
  font-family: system-ui, sans-serif;
}

.settings-list legend {
  float: left;
  width: 100%;
  padding: 12px 16px 4px;
  color: #71717a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.settings-list label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  clear: both;
  padding: 10px 16px;
  border-top: 1px solid #f4f4f5;
  cursor: pointer;
}

.settings-list label:first-of-type {
  border-top: 0;
}

.settings-list label:hover {
  background: #fafafa;
}

.settings-list span {
  display: grid;
  color: #71717a;
  font-size: 12px;
}

.settings-list strong {
  color: #18181b;
  font-size: 14px;
  font-weight: 600;
}

.settings-list input {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  margin: 0;
  border-radius: 999px;
  background: #d4d4d8;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.settings-list input::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.settings-list input:checked {
  background: #16a34a;
}

.settings-list input:checked::before {
  transform: translateX(16px);
}

.settings-list input:focus-visible {
  outline: 2px solid #16a34a;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .settings-list input,
  .settings-list input::before {
    transition: none;
  }
}
```

## Notes

- This CSS Settings Toggle List is 101 lines of pure CSS (1.7 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
