MYDS Logo

    MYDS

    Beta

    Masthead

    The Masthead component is a standardized header for Malaysian government websites.

    Official Malaysia Government Website
    Here's how you know

    Official government websites end with .gov.my

    If the link does not end with .gov.my, exit the website immediately even if it looks similar.

    Secure websites use HTTPS

    Look for a lock () atau https:// as an added precaution. If not present, do not share any sensitive information.

    Usage

    import {
      Masthead,
      MastheadHeader,
      MastheadContent,
      MastheadOfficialIndicator,
      MastheadToggle,
      MastheadSection,
      MastheadSectionTitle,
      MastheadSectionBody,
    } from "@govtechmy/myds-react/masthead";
    import { GovMyIcon, Lock2Icon, LockFillIcon } from "@govtechmy/myds-react/icon";
    export default () => (
      <Masthead>
        <MastheadHeader>
          <MastheadOfficialIndicator>
            Official Malaysia Government Website
          </MastheadOfficialIndicator>
          <MastheadToggle>Here's how you know</MastheadToggle>
        </MastheadHeader>
        <MastheadContent>
          <MastheadSection icon={<GovMyIcon />}>
            <MastheadSectionTitle>
              Official government websites end with .gov.my
            </MastheadSectionTitle>
            <MastheadSectionBody>
              If the link does not end with
              <span className="font-semibold"> .gov.my</span>, exit the website
              immediately even if it looks similar.
            </MastheadSectionBody>
          </MastheadSection>
          <MastheadSection icon={<Lock2Icon height={24} width={24} />}>
            <MastheadSectionTitle>Secure websites use HTTPS</MastheadSectionTitle>
            <MastheadSectionBody>
              Look for a lock (
              <SolidLockIcon className="mb-0.5 inline size-3.5" />) atau
              <span className="font-semibold"> https:// </span>
              as an added precaution. If not present, do not share any sensitive
              information.
            </MastheadSectionBody>
          </MastheadSection>
        </MastheadContent>
      </Masthead>
    );

    Simplified Usage

    Official Malaysia Government Website
    Here's how you know

    Official government websites end with .gov.my

    If the link does not end with .gov.my, exit the website immediately even if it looks similar.

    Secure websites use HTTPS

    Look for a lock () atau https:// as an added precaution. If not present, do not share any sensitive information.

    Simplified Custom Header

    Official Malaysia Government Website
    Here's how you know

    Official government websites end with .gov.my

    If the link does not end with .gov.my, exit the website immediately even if it looks similar.

    Secure websites use HTTPS

    Look for a lock () atau https:// as an added precaution. If not present, do not share any sensitive information.

    Simplified Custom Content

    Official Malaysia Government Website
    Here's how you know

    Official government websites end with .gov.my

    If the link does not end with .gov.my, exit the website immediately even if it looks similar.

    Secure websites use HTTPS

    Look for a lock () atau https:// as an added precaution. If not present, do not share any sensitive information.

    Main Wrapper: Masthead

    The Masthead serves as the primary wrapper for the masthead content. All subcomponents are nested within this wrapper. It is divided into two main sections:

    1. MastheadHeader
    2. MastheadContent

    1.MastheadHeader

    The MastheadHeader is the upper part of the masthead and contains two main areas:

    1.1 MastheadOfficialIndicator
    1.2 MastheadToggle

    1.1 MastheadOfficialIndicator

    The MastheadOfficialIndicator component is designed to clearly communicate that the website is an authorized government portal.

    Components:

    • MalaysiaFlagIcon: Displays the official flag of Malaysia.
    • Text Element: Presents the label "Official Malaysia Government Website."

    1.2 MastheadToggle

    The MastheadToggle component provides an interactive control that allows users to toggle the visibility of additional information.

    Components:

    • ChevronDownIcon: An icon depicting a downward-facing chevron, used to indicate and trigger the dropdown visibility toggle.
    • Label: Displays the text "Here's how you know" when the dropdown is in its collapsed state.

    Example:

    Official Malaysia Government Website

    2. MastheadContent

    The MastheadContent component refers to the lower section of the masthead, which becomes visible upon toggling.

    2.1 MastheadSection

    The MastheadSection represents an individual section within the MastheadContent. It contains the following:

    2.1.1 MastheadSectionTitle

    The MastheadSectionTitle component defines the main heading of a section, providing clear context and guiding the user's focus to the section’s content.

    2.1.2 MastheadSectionBody

    The MastheadSectionBody component contains the primary content of the section, displaying relevant information or media in a structured layout.

    Example:

    Here's how you know

    Official government websites end with .gov.my

    If the link does not end with .gov.my, exit the website immediately even if it looks similar.

    Secure websites use HTTPS

    Look for a lock () atau https:// as an added precaution. If not present, do not share any sensitive information.

    Props

    Masthead

    PropTypeDefault
    children
    ReactNode
    <DefaultMastheadHeadHeader/>,<DefaultMastheadContent/>

    MastheadHeader

    PropTypeDefault
    children
    ReactNode
    -

    MastheadOfficialIndicator

    PropTypeDefault
    children
    ReactNode
    "Official Malaysia Government Website"

    MastheadToggle

    PropTypeDefault
    children
    ReactNode
    "Here's how you know"

    MastheadContent

    PropTypeDefault
    children
    ReactNode
    -

    MastheadSection

    PropTypeDefault
    icon
    ReactNode
    -
    children
    ReactNode
    -

    MastheadSectionTitle

    PropTypeDefault
    children
    ReactNode
    -

    MastheadSectionBody

    PropTypeDefault
    children
    ReactNode
    -

    On this page