Kelvin Switch
A colour temperature slider on the SunUI glass key.
When to use it
- Choosing the colour temperature of a bulb, lamp or ceiling light, for example 2700 K, 4000 K and 6500 K SKUs
- One tactile control that also flips the site between light and dark: onThemeChange fires when the value crosses the threshold
- Product or campaign pages that deal in warm and cool values, such as camera filters, photo editing or screen night modes
Watch out
- kelvinToRgb is an approximation; product photos and real light can still differ, so show real photos for important specs
- Keep preset values in sync with your backend SKUs and add the preset's sku to the cart, not the raw slider value
- The whole stage moves between dark and light, so content passed to before and children must read on both
Let your agent add it
One copy holds the install command, when to use it, the props and the design rules. Paste it into Claude Code, Cursor or Codex.
This is a Pro block
One license unlocks every Pro block, now and in the future.
One-time $129 with a year of updates, or $19 a month. Use it in unlimited personal and client projects; installed blocks stay yours.
Install with your license
- 1. Add the SunUI Pro registry to
components.json.components.json{ "registries": { "@sunui-pro": { "url": "https://sunui.synvize.com/r/pro/{name}.json", "headers": { "Authorization": "Bearer ${SUNUI_LICENSE_KEY}" } } } } - 2. Put your license key in
.env.local.$ SUNUI_LICENSE_KEY=your-license-key - 3. Install the block.
$ npx shadcn@latest add @sunui-pro/kelvin-switch
Similar blocks
- Pro
- Pro
- Pro
- Pro
- Pro





