Nexus UI

Radio Cards, animated React component

A plan picker built on real radio inputs: the selection ring glides between cards, the chosen card opens to show its features, and the button label rolls to the new plan.

  • Free
  • Inputs & Controls
  • Spring

Play with it

Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.

Choose a plan

Props

PropTypeDefaultWhat it does
options—Each option has id, title, description, and optional meta (shown on the right) and features (chips shown when selected).
defaultValue—Id of the option selected at first. Defaults to the second option.
onChange—Called when the selection changes.
autoplayfalseCycles through the options until someone interacts.
accent"#0071e3"Ring, dot and button colour.

Add it to your project

  1. 1

    Prepare your project

    You need Tailwind CSS and the @/import alias. If shadcn isn't set up yet, initialise it once:

    npx shadcn@latest init

    Then add the Nexus registry to your components.json (the registries key is the part that matters):

    {
      "$schema": "https://ui.shadcn.com/schema.json",
      "style": "default",
      "rsc": true,
      "tsx": true,
      "tailwind": {
        "css": "src/app/globals.css",
        "baseColor": "neutral",
        "cssVariables": true,
        "prefix": ""
      },
      "aliases": {
        "components": "@/components",
        "utils": "@/lib/utils",
        "ui": "@/components/ui",
        "lib": "@/lib",
        "hooks": "@/hooks"
      },
      "registries": {
        "@nexus-labs": "https://www.nexus-ui.com/api/registry/{name}"
      }
    }
  2. 2

    Add the component

    Run this from your project root. It adds the component, the utilities it uses and its packages.

    npx shadcn@latest add @nexus-labs/radio-cards
  3. 3

    Check what was added

    With the standard aliases, these files land in your project:

    components/
    radio-cards/
    index.ts
    radio-cards.tsx
  4. 4

    Copying by hand? Install the packages

    Skip this if you used the command above.

    npm install framer-motion
  5. 5

    Use it in a page

    Import it and render it. The Code tab above has the full example.

    // app/page.tsx
    import { RadioCards } from "@/components/radio-cards";
    
    export default function Page() {
      return (
        <main>
          <RadioCards />
        </main>
      );
    }