Dock

Animated Dock component with pre-built positioning setup for all 4 positions of the screen.

Installation
npx @ayushmxxn/serenity-ui@latest add dock
Usage
'use client';
import React from 'react';
import { FaDiscord, FaGithub, FaInstagram, FaLinkedin, FaTwitter } from 'react-icons/fa';
import Dock from './components/ui/dock';

const Home = () => {
  const items = [
    {
      link: 'https://github.com',
      target: '_blank',
      Icon: <FaGithub size={22} />,
      defaultBgColor: 'bg-zinc-700',
      hoverBgColor: 'bg-zinc-700',
      tooltip: 'GitHub', 
    },
    {
      link: 'https://x.com',
      target: '_blank',
      Icon: <FaTwitter size={22} />,
      defaultBgColor: 'bg-zinc-700',
      hoverBgColor: 'bg-zinc-700',
      tooltip: 'Twitter', 
    },
    {
      link: 'https://instagram.com',
      target: '_blank',
      Icon: <FaInstagram size={22} />,
      defaultBgColor: 'bg-zinc-700',
      hoverBgColor: 'bg-zinc-700',
      tooltip: 'Instagram', 
    },
    {
      link: 'https://discord.com/',
      target: '_blank',
      Icon: <FaDiscord size={22} />,
      defaultBgColor: 'bg-zinc-700',
      hoverBgColor: 'bg-zinc-700',
      tooltip: 'Discord', 
    },
    {
      link: 'https://linkedin.com',
      target: '_blank',
      Icon: <FaLinkedin size={22} />,
      defaultBgColor: 'bg-zinc-700',
      hoverBgColor: 'bg-zinc-700',
      tooltip: 'LinkedIn', 
    },
  ];

  return (
    <main className="relative min-h-screen flex items-center justify-center">
      <Dock position="bottom" items={items} />
    </main>
  );
};

export default Home;

Props

Prop NameTypeDescription
iconReact.ReactNode / stringIcon of the dock item
positiontop / bottom / left / rightIcon of the dock item
linkstringURL to navigate to
target_blank / _self / _parent / _topWhere to open the link
defaultBgColorstringBackground color of the dock items
hoverBgColorstringBackground color of the dock item on hover
tooltipstringTooltip for the dock item
Built byAyushmaan Singh. The source code is available onGithub