Writing & Markdown

Buttons

Add call-to-action buttons with gradient styles, sizes, icons, and alignment using the Hugo button shortcode.

A modern, customizable button component with gradient styling, icons, and smart link handling.

Basic Usage

{{</* button url="/contact" */>}}Contact Us{{</* /button */>}}

{{</* button url="https://example.com" new_tab="true" style="secondary" */>}}Visit External Site{{</* /button */>}}

Style Variants

{{</* button url="#" style="primary" */>}}Primary Button{{</* /button */>}}
{{</* button url="#" style="secondary" */>}}Secondary Button{{</* /button */>}}
{{</* button url="#" style="outline" */>}}Outline Button{{</* /button */>}}
{{</* button url="#" style="ghost" */>}}Ghost Button{{</* /button */>}}
StyleDescription
primaryDefault bold gradient button
secondaryMuted/subtle variant
outlineBordered with transparent background
ghostText-only, no border or background

Sizes

{{</* button url="#" size="sm" */>}}Small{{</* /button */>}}
{{</* button url="#" size="md" */>}}Medium (Default){{</* /button */>}}
{{</* button url="#" size="lg" */>}}Large{{</* /button */>}}
{{</* button url="#" size="xl" */>}}Extra Large{{</* /button */>}}

Alignment

{{</* button url="#" align="left" */>}}Left (Default){{</* /button */>}}
{{</* button url="#" align="center" */>}}Center{{</* /button */>}}
{{</* button url="#" align="right" */>}}Right{{</* /button */>}}

Icons

Use icons from Hero Icons:

{{</* button url="#" icon="download" */>}}Download{{</* /button */>}}
{{</* button url="#" icon="arrow-right" icon_position="right" */>}}Continue{{</* /button */>}}

Rounded Corners

{{</* button url="#" rounded="sm" */>}}Small Radius{{</* /button */>}}
{{</* button url="#" rounded="md" */>}}Medium (Default){{</* /button */>}}
{{</* button url="#" rounded="lg" */>}}Large Radius{{</* /button */>}}
{{</* button url="#" rounded="full" */>}}Pill{{</* /button */>}}

Advanced Examples

Call-to-Action

{{</* button url="/signup" style="primary" size="lg" align="center" icon="rocket-launch" */>}}Get Started Today{{</* /button */>}}
{{</* button url="https://github.com/HugoBlox/kit" new_tab="true" style="outline" icon="arrow-top-right-on-square" icon_position="right" */>}}View on GitHub{{</* /button */>}}

Download

{{</* button url="/files/document.pdf" style="secondary" icon="document-arrow-down" rounded="full" */>}}Download PDF{{</* /button */>}}

Parameters

ParameterTypeDefaultDescription
urlstring#Required. Destination URL (internal or external)
textstringInner contentButton text (overrides shortcode content)
new_tabbooleanfalseOpen link in new tab
stylestringprimaryprimary, secondary, outline, ghost
sizestringmdsm, md, lg, xl
alignstringleftleft, center, right
iconstringIcon name from Hero Icons
icon_positionstringleftleft, right
roundedstringmdsm, md, lg, xl, full
disabledbooleanfalseDisable the button

Security

External links automatically get secure attributes:

Link TypeAttributes
Externalrel="noreferrer"
External + new tabrel="noopener noreferrer"
Internal + new tabrel="noopener"

Accessibility

Built-in accessibility features include role="button", aria-label support, keyboard focus indicators, high-contrast focus rings, and disabled state handling.

Was this page helpful?

From the makers of

© 2026 Lore Labs.

On this page