Button Group 15

PreviousNext

Navigation button group with scale animation on press using Framer Motion

Docs
shadcn-studiocomponent

Preview

Loading preview…
registry/new-york/components/button-group/button-group-15.tsx
import * as motion from 'motion/react-client'

import { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react'

import { Button } from '@/registry/new-york/ui/button'

const ButtonGroupScaleDemo = () => {
  return (
    <div className='divide-primary-foreground/30 inline-flex w-fit divide-x rounded-md shadow-xs'>
      <Button className='rounded-none rounded-l-md transition-none focus-visible:z-10' asChild>
        <motion.button whileTap={{ scale: 0.9 }}>
          <ChevronLeftIcon />
          Previous
        </motion.button>
      </Button>
      <Button className='rounded-none rounded-r-md transition-none focus-visible:z-10' asChild>
        <motion.button whileTap={{ scale: 0.9 }}>
          Next
          <ChevronRightIcon />
        </motion.button>
      </Button>
    </div>
  )
}

export default ButtonGroupScaleDemo

Installation

npx shadcn@latest add @shadcn-studio/button-group-15

Usage

import { ButtonGroup15 } from "@/components/button-group-15"
<ButtonGroup15 />