--- author: "Mark Dumay" title: "Custom Shortcodes" date: 2022-12-05 description: "Available shortcodes using Bootstrap components and styling." tags: ["bootstrap", "shortcode"] thumbnail: img/sketch.jpg photoCredits: picjumbo.com photoSource: Pexels --- Bootstrap is an open-source web development framework originally created by Twitter. It uses a responsive, mobile-first approach that scales seamlessly across different screen sizes. Bootstrap includes an extensive collection of ready-to-use components, such as navigation bars, pagination controls, buttons, and much more. The Hinode theme exposes several of those components as Hugo shortcodes to simplify their usage within markdown content. The below paragraphs illustrate the available shortcodes and how to use them. ## Alert Use the `alert` shortcode to display a contextual feedback message. The inner content is used as alert text. The shortcode supports the following arguments: | Argument | Required | Description | |-------------|----------|-------------| | color | No | Optional theme color of the alert, either "primary" (default), "secondary", "success", "danger", "warning", "info", "light", or "dark". | | dismissible | No | Optional flag to indicate the alert is dismissible, defaults to false. | {.table} As an example, the following shortcode displays a simple alert. ```html {{}} A simple danger alert—check it out! {{}} ``` The result looks like this: {{< alert color="danger" >}} A simple danger alert—check it out! {{< /alert >}} ## Breadcrumb Use the `breadcrumb` shortcode to display the current page’s location within the site's navigational hierarchy. The shortcode requires no arguments, see the following example. ```html {{}} ``` The result looks like this: {{< breadcrumb >}} ## Button Use the `button` shortcode to display a button with a hyperlink. The inner content is used as button title. The button supports an optional badge and tooltip. The shortcode supports the following arguments: | Argument | Required | Description | |-------------|----------|-------------| | href | Yes | Address for the button hyperlink. | | state | No | Optional state of the button, either "enabled" (default), "disabled", "active", or "inactive". | | size | No | Optional size of the button, either "sm", "md" (default), or "lg". | | color | No | Optional theme color of the element, either "primary" (default), "secondary", "success", "danger", "warning", "info", "light", or "dark". | | badge | No | Optional positioned badge to display on top of the button. | | outline | No | Optional flag indicating the button should be outlined, either "false" (default) or "true". | | aria-label | No | Optional label for the badge. | | tooltip | No | Optional title to display in a tooltip. Ignored for active/inactive buttons. | | placement | No | How to position the tooltip: "top" (default), "bottom", "left", or "right". | {.table} As an example, the following shortcode displays a tooltip for a dark button with a badge. ```html {{}} Inbox {{}} ``` The result looks like this: {{< button color="dark" tooltip="Click on the inbox to view your unread messages" href="#" badge="99+" >}} Inbox {{< /button >}} ## Button Group Use the `button-group` shortcode to display a group of buttons. Add inner `