Hero

A hero section is the area that immediately shows up on the screen under the logo and menu.

Preview

Usage

npm i react-hartan

Customization With Props

  • heroHeadName -> Accepts a string/node value, used as the heading of hero section.

  • heroAbout -> Accepts a node/string value, used as the content of hero section.

  • imgSrc -> Accepts a string value, the source link for the image used in hero section.

  • imgState -> Accepts a Boolean value, the state for showing/hiding the hero image.

  • imgAlt -> Accepts an image alt.

  • buttonText -> Accepts a string/node value, the name used for the button inside hero section.

  • onClickFunction -> Accepts a function, written by the user, for handling onClick logic on button.

  • id -> The id prop is similar to the id attribute in HTML. It allows to provide overall component id.

  • imgLoad -> The imgLoad prop is mapped to the loading attribute in HTML img tag. It allows to provide overall the value for loading attribute, "lazy" | "eager".

  • userHeroSectionStyle -> Accepts the class name(s) as string, custom styling prop for the hero section container.

  • userHeroContentStyle -> Accepts the class names(s) as string, custom styling prop for the hero about container containing heading, paragraph and the button.

  • userButtonStyle -> Accepts the class names(s) as string, custom styling prop for the button.

Component Code

This is the code for Hero Section component.

Last updated