Skip to content

    Browse components

    Shy Button

    A playful yes/no prompt whose No button springs away from the cursor, leaning into each hop, until it gets tired. Keyboard users can always press it.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/shy-button

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/shy-button.json

    Usage

    import { ShyButton } from "@/components/ui/shy-button";
    
    <ShyButton
      question="Deploy on a Friday afternoon?"
      onYes={() => ship()}
      onNo={() => wait()}
    />

    Props

    PropTypeDefaultDescription
    questionstring"Deploy on a Friday afternoon?"The question above the buttons.
    yesLabelstring"Yes"Yes button label.
    noLabelstring"No"No button label.
    radiusnumber80Px around No in which the pointer makes it flee.
    maxDodgesnumber8Dodges before No gives up (0 = never).
    colorstring"#f472b6"Yes button and celebration color.
    onYesReactNode—Called when Yes is chosen.
    onNoReactNode—Called when No is finally chosen.
    classNamestring—Extra classes for the root element.