25 / 47
All 47 in 47 CSS Toggles & Switches
- 01Minimal iOS-Style Toggle Switch
- 02Dark Mode Sun / Moon Theme Switcher
- 033D Neumorphic Pill Toggle
- 04Gooey Liquid Morphing Switch
- 05Bouncy Elastic Physics Toggle
- 06Inner Text ON / OFF Switch
- 07SaaS Pricing Segmented Pill Toggle
- 08Haptic Mechanical Keycap Toggles
- 09Waveform Mute Toggle
- 10Timed Auto-Off Toggle
- 11Biometric Hold-to-Confirm Scan Toggle
- 12Split-Flap Departure Board Toggle
- 13Permission Stack with Live Status
- 14Material Design 3 Switch
- 15Skeuomorphic Wall Light Switch
- 16Neon Cyberpunk Toggle
- 17Brutalist Snap Toggle
- 18Day / Night Landscape Scene Switch
- 193D Flip Card Toggle
- 20Sliding Pill with Traveling Label
- 21Glassmorphism Frosted Toggle
- 22Skeuomorphic Rotary Knob Toggle
- 23iOS Light Mode Settings List
- 24Outline Minimal currentColor Toggle
- 25Bouncy Pebble Organic Toggle
- 26Industrial Rocker I/O Switch
- 27Accessible ARIA role=switch Toggle
- 28Haptic Keys
- 29Waveform Toggle
- 30Timed Toggle
- 31Biometric Scan
- 32Split-Flap Board
- 33Permission Stack
- 34iOS
- 35Material Design
- 36Skeuomorphic Light Switch
- 37Neon Cyber
- 38Brutalist
- 39Day / Night
- 40Flip Card
- 41Sliding Pill with Label
- 42Glassmorphism
- 43Skeuomorphic Knob
- 44iOS Light Mode
- 45Outline
- 46Bouncy Pebble
- 47Industrial Rocker
Bouncy Pebble Organic Toggle
A soft river pebble instead of a circle: the asymmetric blob thumb squashes flat as it launches, stretches mid-flight and wobbles back into shape on landing — squash-and-stretch cartoon physics from one keyframe block, in a warm organic palette.
Build interactive UI like this from scratch: 20 HTML, CSS & JavaScript projects
ZTM · JavaScript Web Projects · 30‑day money-back guarantee · Affiliate link
The code
<section class="tgl-25" aria-label="Bouncy pebble organic toggle">
<label class="tgl-25__row" for="tgl-25-sw">
<span class="tgl-25__lbl">Rain sounds</span>
<input type="checkbox" id="tgl-25-sw" class="tgl-25__sw" role="switch">
</label>
<p class="tgl-25__cap">Squash · stretch · wobble</p>
</section><section class="tgl-25" aria-label="Bouncy pebble organic toggle">
<label class="tgl-25__row" for="tgl-25-sw">
<span class="tgl-25__lbl">Rain sounds</span>
<input type="checkbox" id="tgl-25-sw" class="tgl-25__sw" role="switch">
</label>
<p class="tgl-25__cap">Squash · stretch · wobble</p>
</section>.tgl-25,
.tgl-25 *,
.tgl-25 *::before,
.tgl-25 *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
.tgl-25 {
--on: oklch(0.62 0.1 155);
--pebble: #f6f2e8;
font-family: 'Segoe UI',system-ui,sans-serif;
width: 100%;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 26px;
padding: 60px 20px;
background: #e9e4d6;
}
.tgl-25__row {
display: flex;
align-items: center;
gap: 32px;
cursor: pointer;
background: #f3efe3;
border-radius: 22px;
padding: 20px 28px;
box-shadow: 0 12px 30px -20px rgba(90,80,50,.55);
}
.tgl-25__lbl {
font-size: 16px;
font-weight: 600;
color: #4c4a3c;
}
.tgl-25__sw {
appearance: none;
-webkit-appearance: none;
flex: none;
width: 82px;
height: 44px;
border-radius: 26px;
background: #d8d2bf;
position: relative;
cursor: pointer;
transition: background-color .5s;
}
.tgl-25__sw:checked {
background: var(--on);
}
.tgl-25__sw::before {
content: "";
position: absolute;
top: 5px;
left: 5px;
width: 34px;
height: 34px;
border-radius: 40% 60% 55% 45% / 55% 45% 60% 40%;
background: var(--pebble);
box-shadow: 0 3px 7px rgba(90,80,50,.4);
animation: tgl-25-back .55s cubic-bezier(.3,.7,.4,1) forwards;
}
.tgl-25__sw:checked::before {
animation: tgl-25-go .55s cubic-bezier(.3,.7,.4,1) forwards;
border-radius: 60% 40% 45% 55% / 45% 55% 40% 60%;
}
@keyframes tgl-25-go {
0% {
transform: translateX(0) scale(1,1);
}
15% {
transform: translateX(-3px) scale(.85,1.12);
}
45% {
transform: translateX(20px) scale(1.28,.76);
}
70% {
transform: translateX(38px) scale(.9,1.08);
}
85% {
transform: translateX(38px) scale(1.06,.95);
}
100% {
transform: translateX(38px) scale(1,1);
}
}
@keyframes tgl-25-back {
0% {
transform: translateX(38px) scale(1,1);
}
15% {
transform: translateX(41px) scale(.85,1.12);
}
45% {
transform: translateX(18px) scale(1.28,.76);
}
70% {
transform: translateX(0) scale(.9,1.08);
}
85% {
transform: translateX(0) scale(1.06,.95);
}
100% {
transform: translateX(0) scale(1,1);
}
}
.tgl-25__sw:focus-visible {
outline: 3px solid var(--on);
outline-offset: 4px;
}
.tgl-25__cap {
font-size: 12px;
letter-spacing: .12em;
text-transform: uppercase;
color: #a29a80;
}
@media (prefers-reduced-motion: reduce) {
.tgl-25__sw::before {
animation: none;
transition: transform .2s;
}
.tgl-25__sw:checked::before {
transform: translateX(38px);
}
}.tgl-25,
.tgl-25 *,
.tgl-25 *::before,
.tgl-25 *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
.tgl-25 {
--on: oklch(0.62 0.1 155);
--pebble: #f6f2e8;
font-family: 'Segoe UI',system-ui,sans-serif;
width: 100%;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 26px;
padding: 60px 20px;
background: #e9e4d6;
}
.tgl-25__row {
display: flex;
align-items: center;
gap: 32px;
cursor: pointer;
background: #f3efe3;
border-radius: 22px;
padding: 20px 28px;
box-shadow: 0 12px 30px -20px rgba(90,80,50,.55);
}
.tgl-25__lbl {
font-size: 16px;
font-weight: 600;
color: #4c4a3c;
}
.tgl-25__sw {
appearance: none;
-webkit-appearance: none;
flex: none;
width: 82px;
height: 44px;
border-radius: 26px;
background: #d8d2bf;
position: relative;
cursor: pointer;
transition: background-color .5s;
}
.tgl-25__sw:checked {
background: var(--on);
}
.tgl-25__sw::before {
content: "";
position: absolute;
top: 5px;
left: 5px;
width: 34px;
height: 34px;
border-radius: 40% 60% 55% 45% / 55% 45% 60% 40%;
background: var(--pebble);
box-shadow: 0 3px 7px rgba(90,80,50,.4);
animation: tgl-25-back .55s cubic-bezier(.3,.7,.4,1) forwards;
}
.tgl-25__sw:checked::before {
animation: tgl-25-go .55s cubic-bezier(.3,.7,.4,1) forwards;
border-radius: 60% 40% 45% 55% / 45% 55% 40% 60%;
}
@keyframes tgl-25-go {
0% {
transform: translateX(0) scale(1,1);
}
15% {
transform: translateX(-3px) scale(.85,1.12);
}
45% {
transform: translateX(20px) scale(1.28,.76);
}
70% {
transform: translateX(38px) scale(.9,1.08);
}
85% {
transform: translateX(38px) scale(1.06,.95);
}
100% {
transform: translateX(38px) scale(1,1);
}
}
@keyframes tgl-25-back {
0% {
transform: translateX(38px) scale(1,1);
}
15% {
transform: translateX(41px) scale(.85,1.12);
}
45% {
transform: translateX(18px) scale(1.28,.76);
}
70% {
transform: translateX(0) scale(.9,1.08);
}
85% {
transform: translateX(0) scale(1.06,.95);
}
100% {
transform: translateX(0) scale(1,1);
}
}
.tgl-25__sw:focus-visible {
outline: 3px solid var(--on);
outline-offset: 4px;
}
.tgl-25__cap {
font-size: 12px;
letter-spacing: .12em;
text-transform: uppercase;
color: #a29a80;
}
@media (prefers-reduced-motion: reduce) {
.tgl-25__sw::before {
animation: none;
transition: transform .2s;
}
.tgl-25__sw:checked::before {
transform: translateX(38px);
}
}/* No JavaScript — paired check/uncheck keyframes choreograph anticipate, mid-flight stretch and landing wobble on the blob thumb's transform. */
/* No JavaScript — paired check/uncheck keyframes choreograph anticipate, mid-flight stretch and landing wobble on the blob thumb's transform. */Here's a working CSS Toggles & Switche from CodeFronts. Use it as-is or adapt to your framework. All classes are scoped under a unique prefix so the code won't collide with your existing styles. MIT licensed.
Demo: Bouncy Pebble Organic Toggle
Source: https://codefronts.com/components/css-toggles-switches/bouncy-pebble-organic-toggle/
A soft river pebble instead of a circle: the asymmetric blob thumb squashes flat as it launches, stretches mid-flight and wobbles back into shape on landing — squash-and-stretch cartoon physics from one keyframe block, in a warm organic palette.
## HTML
```html
<section class="tgl-25" aria-label="Bouncy pebble organic toggle">
<label class="tgl-25__row" for="tgl-25-sw">
<span class="tgl-25__lbl">Rain sounds</span>
<input type="checkbox" id="tgl-25-sw" class="tgl-25__sw" role="switch">
</label>
<p class="tgl-25__cap">Squash · stretch · wobble</p>
</section>
```
## CSS
```css
.tgl-25,
.tgl-25 *,
.tgl-25 *::before,
.tgl-25 *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
.tgl-25 {
--on: oklch(0.62 0.1 155);
--pebble: #f6f2e8;
font-family: 'Segoe UI',system-ui,sans-serif;
width: 100%;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 26px;
padding: 60px 20px;
background: #e9e4d6;
}
.tgl-25__row {
display: flex;
align-items: center;
gap: 32px;
cursor: pointer;
background: #f3efe3;
border-radius: 22px;
padding: 20px 28px;
box-shadow: 0 12px 30px -20px rgba(90,80,50,.55);
}
.tgl-25__lbl {
font-size: 16px;
font-weight: 600;
color: #4c4a3c;
}
.tgl-25__sw {
appearance: none;
-webkit-appearance: none;
flex: none;
width: 82px;
height: 44px;
border-radius: 26px;
background: #d8d2bf;
position: relative;
cursor: pointer;
transition: background-color .5s;
}
.tgl-25__sw:checked {
background: var(--on);
}
.tgl-25__sw::before {
content: "";
position: absolute;
top: 5px;
left: 5px;
width: 34px;
height: 34px;
border-radius: 40% 60% 55% 45% / 55% 45% 60% 40%;
background: var(--pebble);
box-shadow: 0 3px 7px rgba(90,80,50,.4);
animation: tgl-25-back .55s cubic-bezier(.3,.7,.4,1) forwards;
}
.tgl-25__sw:checked::before {
animation: tgl-25-go .55s cubic-bezier(.3,.7,.4,1) forwards;
border-radius: 60% 40% 45% 55% / 45% 55% 40% 60%;
}
@keyframes tgl-25-go {
0% {
transform: translateX(0) scale(1,1);
}
15% {
transform: translateX(-3px) scale(.85,1.12);
}
45% {
transform: translateX(20px) scale(1.28,.76);
}
70% {
transform: translateX(38px) scale(.9,1.08);
}
85% {
transform: translateX(38px) scale(1.06,.95);
}
100% {
transform: translateX(38px) scale(1,1);
}
}
@keyframes tgl-25-back {
0% {
transform: translateX(38px) scale(1,1);
}
15% {
transform: translateX(41px) scale(.85,1.12);
}
45% {
transform: translateX(18px) scale(1.28,.76);
}
70% {
transform: translateX(0) scale(.9,1.08);
}
85% {
transform: translateX(0) scale(1.06,.95);
}
100% {
transform: translateX(0) scale(1,1);
}
}
.tgl-25__sw:focus-visible {
outline: 3px solid var(--on);
outline-offset: 4px;
}
.tgl-25__cap {
font-size: 12px;
letter-spacing: .12em;
text-transform: uppercase;
color: #a29a80;
}
@media (prefers-reduced-motion: reduce) {
.tgl-25__sw::before {
animation: none;
transition: transform .2s;
}
.tgl-25__sw:checked::before {
transform: translateX(38px);
}
}
```
## JavaScript
```js
/* No JavaScript — paired check/uncheck keyframes choreograph anticipate, mid-flight stretch and landing wobble on the blob thumb's transform. */
```Here's a working CSS Toggles & Switche from CodeFronts. Use it as-is or adapt to your framework. All classes are scoped under a unique prefix so the code won't collide with your existing styles. MIT licensed.
Demo: Bouncy Pebble Organic Toggle
Source: https://codefronts.com/components/css-toggles-switches/bouncy-pebble-organic-toggle/
A soft river pebble instead of a circle: the asymmetric blob thumb squashes flat as it launches, stretches mid-flight and wobbles back into shape on landing — squash-and-stretch cartoon physics from one keyframe block, in a warm organic palette.
## HTML
```html
<section class="tgl-25" aria-label="Bouncy pebble organic toggle">
<label class="tgl-25__row" for="tgl-25-sw">
<span class="tgl-25__lbl">Rain sounds</span>
<input type="checkbox" id="tgl-25-sw" class="tgl-25__sw" role="switch">
</label>
<p class="tgl-25__cap">Squash · stretch · wobble</p>
</section>
```
## CSS
```css
.tgl-25,
.tgl-25 *,
.tgl-25 *::before,
.tgl-25 *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
.tgl-25 {
--on: oklch(0.62 0.1 155);
--pebble: #f6f2e8;
font-family: 'Segoe UI',system-ui,sans-serif;
width: 100%;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 26px;
padding: 60px 20px;
background: #e9e4d6;
}
.tgl-25__row {
display: flex;
align-items: center;
gap: 32px;
cursor: pointer;
background: #f3efe3;
border-radius: 22px;
padding: 20px 28px;
box-shadow: 0 12px 30px -20px rgba(90,80,50,.55);
}
.tgl-25__lbl {
font-size: 16px;
font-weight: 600;
color: #4c4a3c;
}
.tgl-25__sw {
appearance: none;
-webkit-appearance: none;
flex: none;
width: 82px;
height: 44px;
border-radius: 26px;
background: #d8d2bf;
position: relative;
cursor: pointer;
transition: background-color .5s;
}
.tgl-25__sw:checked {
background: var(--on);
}
.tgl-25__sw::before {
content: "";
position: absolute;
top: 5px;
left: 5px;
width: 34px;
height: 34px;
border-radius: 40% 60% 55% 45% / 55% 45% 60% 40%;
background: var(--pebble);
box-shadow: 0 3px 7px rgba(90,80,50,.4);
animation: tgl-25-back .55s cubic-bezier(.3,.7,.4,1) forwards;
}
.tgl-25__sw:checked::before {
animation: tgl-25-go .55s cubic-bezier(.3,.7,.4,1) forwards;
border-radius: 60% 40% 45% 55% / 45% 55% 40% 60%;
}
@keyframes tgl-25-go {
0% {
transform: translateX(0) scale(1,1);
}
15% {
transform: translateX(-3px) scale(.85,1.12);
}
45% {
transform: translateX(20px) scale(1.28,.76);
}
70% {
transform: translateX(38px) scale(.9,1.08);
}
85% {
transform: translateX(38px) scale(1.06,.95);
}
100% {
transform: translateX(38px) scale(1,1);
}
}
@keyframes tgl-25-back {
0% {
transform: translateX(38px) scale(1,1);
}
15% {
transform: translateX(41px) scale(.85,1.12);
}
45% {
transform: translateX(18px) scale(1.28,.76);
}
70% {
transform: translateX(0) scale(.9,1.08);
}
85% {
transform: translateX(0) scale(1.06,.95);
}
100% {
transform: translateX(0) scale(1,1);
}
}
.tgl-25__sw:focus-visible {
outline: 3px solid var(--on);
outline-offset: 4px;
}
.tgl-25__cap {
font-size: 12px;
letter-spacing: .12em;
text-transform: uppercase;
color: #a29a80;
}
@media (prefers-reduced-motion: reduce) {
.tgl-25__sw::before {
animation: none;
transition: transform .2s;
}
.tgl-25__sw:checked::before {
transform: translateX(38px);
}
}
```
## JavaScript
```js
/* No JavaScript — paired check/uncheck keyframes choreograph anticipate, mid-flight stretch and landing wobble on the blob thumb's transform. */
```How this works
The thumb's organic silhouette is an asymmetric 8-value border-radius (40% 60% 55% 45% / 55% 45% 60% 40%). Motion is two keyframe animations — one for checking, one for unchecking — that choreograph translateX WITH scaleX/scaleY: anticipate (squash 1.15/.85), launch (stretch 1.25/.8 mid-travel), land (overshoot), wobble (two diminishing counter-squashes). A transition can't sequence this; keyframes can.
Each state applies its own animation name with forwards fill, so the same choreography plays mirrored on the way back. The border-radius values also morph slightly between states, making the pebble feel hand-formed rather than stamped.
Make it yours
- Exaggerate cartoon-ness: push mid-flight stretch to 1.4/.7.
- Reshape the pebble by editing the 8 border-radius percentages.
- Palette swap: sage/cream here; try clay/sand or moss/stone.
- Add a landing dust-puff: a ::after ring that scales+fades on the landing keyframe.
Gotchas — read before shipping
- Two named animations (in/out) are required — a single transition cannot express anticipate→stretch→wobble.
- The uncheck animation also runs once on first load; harmless, but start the demo checked if that bothers you.
- Keep all squash on transform scale — animating border-radius alone mid-flight jitters on low-end GPUs.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 111+ | 15.4+ | 113+ | 111+ |
Floor set by oklch() as this demo is written. The core technique itself goes back further — Chrome 43+.
Keyframe animations on transform; universal support.