Skip to content

Vibecoded toggle switch? #5120

Closed
Closed

Description

@vaporvee

To Reproduce

Current vs. Expected behavior

Image Image

The postioning of the enabled thumb is very weird. i recommend just using the default one from https://ui.shadcn.com/docs/components/base/switch

Provide environment information

-

Which area(s) are affected? (Select all that apply)

Application

Are you deploying the applications where Dokploy is installed or on a remote server?

Same server where Dokploy is installed

Additional context

No response

Will you send a PR to fix it?

Maybe, need help

Activity

  1. linear-code commented on Aug 18, 2026

    @linear-code
  2. dosubot commented on Aug 18, 2026

    @dosubot

    Hi @vaporvee! I'm Dosu and I'm helping the Dokploy team.

    The problem is in apps/dokploy/components/ui/switch.tsx. The thumb element uses translate-x-[calc(100%-2px)] for the checked state [1], but 100% here refers to the thumb's own width (16px for default, 12px for sm), not the track width — so it only translates ~14px/~10px instead of the full distance across the track. This produces the misaligned thumb you're seeing.

    A fix would be replacing the calc values with explicit pixel offsets that match track width minus thumb size minus borders. For the default size (track w-9 = 36px, thumb size-4 = 16px) and the sm size (track w-[24px], thumb size-3 = 12px) [2], something like:

    group-data-[size=default]/switch:data-checked:translate-x-4
    group-data-[size=sm]/switch:data-checked:translate-x-[10px]

    Or, as you suggested, just pull in the canonical shadcn switch component from https://ui.shadcn.com/docs/components/base/switch — that's the most reliable baseline.

    If you'd like to send a PR, the relevant code is the SwitchPrimitive.Thumb className on lines 23–26.

    To reply, just mention @dosu.


    Docs are dead. Just use Dosu.

    Leave Feedback Ask Dosu about dokploy Share Dosu with your team

  3. added a commit that references this issue on Aug 18, 2026
    76c2416
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions