Skip to main content

Footer Block

The Footer Component is a fully customizable and accessible footer section built with React and TypeScript. It provides a complete website footer interface with modern design patterns, logo display, content sections, and flexible customization options.


πŸš€ Installation​

npm install @nodeblocks/frontend-footer-block

πŸ“– Usage​

import {Footer} from '@nodeblocks/frontend-footer-block';
Live Editor
function BasicFooter() {
  return (
    <Footer
      logoSrc="/img/icon-small.png"
      content={
        <div>
          <p>Your trusted partner for business solutions.</p>
          <p>Contact us: info@example.com | +1 (555) 123-4567</p>
        </div>
      }
      copyright="Β© 2024 Your Company Name. All rights reserved.">
      <Footer.Logo />
      <Footer.Content />
      <Footer.Copyright />
    </Footer>
  );
}
Result
Loading...

πŸ”§ Props Reference​

Main Component Props​

PropTypeDefaultDescription
logoSrcstringRequiredURL or path to the logo image to display in the footer
contentReactNodeRequiredThe main content section of the footer (can include text, links, etc.)
copyrightReactNodeRequiredCopyright text or component to display at the bottom of the footer
classNamestringundefinedAdditional CSS class name for styling the footer container
childrenBlocksOverrideundefinedCustom block components to override default rendering

Note: The main component inherits all HTML footer element props.

Sub-Components​

The Footer component provides several sub-components. All sub-components receive their default values from the main component's context and can override these values through props.

PropTypeDefaultDescription
srcstringContext logoSrcURL or path to the logo image (overrides context logoSrc)

Note: This component inherits all HTML img element props.

Footer.Content​

PropTypeDefaultDescription
childrenReactNodeContext contentContent to display in the footer content section (overrides context content)

Note: This component inherits all HTML div element props.

Footer.Copyright​

PropTypeDefaultDescription
childrenReactNodeContext copyrightCopyright text or content to display (overrides context copyright)

Note: This component inherits all HTML div element props.


πŸ”§ TypeScript Support​

Full TypeScript support with comprehensive type definitions:

import {Footer} from '@nodeblocks/frontend-footer-block';
import {ComponentProps, ReactNode} from 'react';

// Main component interface
interface FooterProps extends Omit<ComponentProps<'footer'>, 'content'> {
logoSrc: string;
content: ReactNode;
copyright: ReactNode;
children?: BlocksOverride<DefaultBlocks, CustomBlocks>;
}

// Context type (values passed to all sub-components)
interface FooterContextValue {
logoSrc: string;
copyright: ReactNode;
content: ReactNode;
}

// Example with comprehensive footer content
function CustomFooter() {
return (
<Footer
logoSrc="/assets/company-logo.svg"
content={
<div>
<div>
<h4>Contact Information</h4>
<p>Email: info@company.com</p>
<p>Phone: +1 (555) 123-4567</p>
<p>Address: 123 Business St, City, State 12345</p>
</div>
<div>
<h4>Quick Links</h4>
<ul>
<li>
<a href="#about">About Us</a>
</li>
<li>
<a href="#services">Services</a>
</li>
<li>
<a href="#contact">Contact</a>
</li>
</ul>
</div>
</div>
}
copyright="Β© 2024 Your Company Name. All rights reserved."
className="custom-footer">
<Footer.Logo className="company-logo" alt="Company Logo" />
<Footer.Content className="footer-main-content" />
<Footer.Copyright className="footer-copyright" style={{fontSize: '14px', color: '#666'}}>
Β© 2024 Custom Company. All rights reserved. | Privacy Policy | Terms of Service
</Footer.Copyright>
</Footer>
);
}

Built with ❀️ using React, TypeScript, and modern web standards.