Skip to content

Announcement

The announcement component displays in the sidebar for showing important notices or messages.

Config File

src/config/announcementConfig.ts

Properties

PropertyTypeDefaultDescription
titlestring-Announcement title
contentstring-Announcement content
iconstring-Icon (Iconify format)
typestring-Type: "info", "warning", "success", "error"
closablebooleantrueAllow users to close
PropertyTypeDefaultDescription
link.enablebooleantrueEnable link
link.textstring-Link text
link.urlstring-Link URL
link.externalbooleanfalseExternal link

Example

ts
export const announcementConfig: AnnouncementConfig = {
  title: "Announcement",
  content: "Welcome to my blog! This is a sample announcement.",
  closable: true,
  link: {
    enable: true,
    text: "Learn more",
    url: "/about/",
    external: false,
  },
};

TIP

The announcement component's visibility is controlled in sidebarConfig.ts by setting the announcement component's enable property.