Skip to main content

How To Use Block

HowToUse is a marketing steps section built on MUI with a centered header, a row of step cards connected by arrows, and a footer call-to-action link button.

Installation

npm install @nodeblocks/frontend-how-to-use-block

What You Need

ItemWhy it matters
subtitleLarge headline
headerContentSupporting label above the headline
cardListContent for step cards
messageOptional footer line above the CTA
linkHrefhref for the footer contained button
linkContentLabel on the footer button
Content lives in your app

Pass header copy, step cards, and CTA text from your page or CMS. Each card needs an MUI icon, headerContent, and body text as children. Provide cards via cardList on the root, or compose HowToUse.CardList children directly.

Code Examples

Live Editor
function Example() {
  const cardList = [
    <HowToUse.Card key="apply" icon={EditOutlined} headerContent="Apply">
      Create your account and tell us about your skills and experience.
    </HowToUse.Card>,
    <HowToUse.Card key="account" icon={AccountBoxOutlined} headerContent="Set up your profile">
      Add your work history, portfolio links, and preferences.
    </HowToUse.Card>,
    <HowToUse.Card key="post" icon={AddToQueue} headerContent="Start matching">
      Browse opportunities and apply to roles that fit your goals.
    </HowToUse.Card>,
  ];

  return (
    <HowToUse
      subtitle="How it works"
      headerContent="STEPS"
      message="Get started in minutes"
      linkHref="#sign-up"
      linkContent="Create free account"
      cardList={cardList}
    />
  );
}
Result
Loading...

Important Props

Core Props

PropTypeRequiredDefaultDescription
subtitleReactNodeYesLarge headline in HowToUse.Header (h1, responsive up to 45px)
headerContentReactNodeYesSupporting label in HowToUse.Header (primary.main, responsive h6/h4)
messageReactNodeYesFooter line above the CTA in HowToUse.Footer (hidden when falsy)
linkHrefstringYeshref on the footer contained button
linkContentReactNodeYesLabel on the footer button
cardListReactNode[]NoundefinedStep cards rendered by HowToUse.CardList when CardList has no children

Layout and Composition Props

PropTypeRequiredDefaultDescription
childrenReactNode | functionNoundefinedCompound sub-components (HowToUse.Header, HowToUse.CardList, HowToUse.Card, HowToUse.Footer) or a function ({ defaultBlocks, defaultBlockOrder }) => ({ blocks, blockOrder }) to inject or reorder layout blocks
classNamestringNoundefinedClass name on the root stack (nbb-how-to-use)
sxSxPropsNoundefinedMUI system styles for the root stack
spacingStackProps['spacing']No{ xs: 5, sm: 6 }Vertical spacing on the root stack

HowToUse inherits StackProps (except children). Default defaultBlockOrder: header, cardList, card, footer.

Sub-component props

Sub-components read from context and accept the same content keys as props to override locally.

Sub-componentMain PropsInheritsBuilt on
HowToUse.Headersubtitle, headerContent, children, className, sxStackPropsStack + Typography
HowToUse.CardListcardList, children, className, sxStackPropsStack + ArrowRight / ArrowDropDown between cards
HowToUse.Cardicon, headerContent, children, className, sxCardPropsCard + Typography
HowToUse.Footermessage, linkHref, linkContent, children, className, sxStackPropsStack + Button (variant="contained", size="large")

Default UI Blocks

BlockBuilt onNotes
HowToUse (root)StackColumn layout(nbb-how-to-use)
header (HowToUse.Header)Stack + TypographyCentered headerContent and subtitle headline
cardList (HowToUse.CardList)Stack + arrow iconsColumn on xs, row on sm+; ArrowDropDown between cards on small screens, ArrowRight on larger screens
card (HowToUse.Card)Card + Typographyarticle card; icon, headerContent, and body text (nbb-how-to-use-card)
footer (HowToUse.Footer)Stack + ButtonOptional message line and contained CTA with linkHref / linkContent;(nbb-how-to-use-footer)

Default root render order: headercardListfooter.

TypeScript

import * as React from 'react';
import type { SvgIconComponent } from '@mui/icons-material';
import { HowToUse } from '@nodeblocks/frontend-how-to-use-block';
import type { ReactNode } from 'react';

type HowToUseStep = {
key: string;
icon: SvgIconComponent;
headerContent: ReactNode;
body: ReactNode;
};

type HowToUseSectionProps = {
subtitle: ReactNode;
headerContent: ReactNode;
message: ReactNode;
linkHref: string;
linkContent: ReactNode;
steps: HowToUseStep[];
};

export function HowToUseSection({
subtitle,
headerContent,
message,
linkHref,
linkContent,
steps,
}: HowToUseSectionProps) {
const cardList = steps.map(({ key, icon, headerContent: title, body }) => (
<HowToUse.Card key={key} icon={icon} headerContent={title}>
{body}
</HowToUse.Card>
));

return (
<HowToUse
subtitle={subtitle}
headerContent={headerContent}
message={message}
linkHref={linkHref}
linkContent={linkContent}
cardList={cardList}
/>
);
}