Snippet

Footer

My website footer component.

Demo

Usage

  1. I typically create a config file in src/lib/config.ts to store site settings like my name and website URL.

    src/lib/config.ts
    export const MY_WEBSITE_URL = 'https://www.stevegray.io/'
    export const MY_NAME = 'Steve Gray'
  2. Then I can always just copy and paste this footer component into my project.

    src/components/footer.tsx
    import Link from 'next/link'
     
    import { MY_NAME, MY_WEBSITE_URL } from '@/lib/config/site'
     
    const Footer = () => {
      return (
        <footer className='flex items-center justify-center gap-1 py-8 text-xs'>
          <span className='text-muted-foreground'>Created by</span>
          <Link target='_blank' href={MY_WEBSITE_URL} className='underline'>
            {MY_NAME}
          </Link>
        </footer>
      )
    }
     
    export default Footer