Skip to content

Links and buttons

A link goes to a destination. A button performs an action in the current interface. Keep that distinction in the HTML even when the two look similar. Name the destination or action so the label makes sense outside its paragraph.

Use a plain link inside prose. A paragraph full of buttons makes it harder to read the relationship between the destinations.

Give one route emphasis

MaterialX link buttons work directly with Markdown attribute lists. Use the primary modifier for the route that follows from the page's main idea.

Basecoat and daisyUI also style anchors. The same source pattern carries their class names, so you can keep the link in Markdown while matching nearby HTML controls.

The first anchor uses Basecoat's outline variant. The second uses daisyUI's prefixed outline modifier. Do not put both component families on one element.

A button needs an action

Both buttons below reset their own form. The browser supplies the behaviour; neither button sends information to a server. Change the sample family name, then click the reset button to restore it.

The sample family is fictional. If you repeat this specimen, rename both input IDs and the matching for attributes.

Show an unavailable action honestly

Native disabled prevents button activation. Explain the cause in nearby text in your application; colour or a tooltip alone is insufficient.

Button · Basecoat

Change the text, then reset the form. The second button demonstrates a native disabled control. Give unavailable actions an explanation in a real interface.

HTML · compiled output
<div class="fltheme-components">
<form class="fl-demo-row"><input aria-label="Basecoat demonstration text" class="input" value="Sample text"><button class="btn" type="reset">Reset text</button><button class="btn" disabled>Export unavailable</button></form>
</div>

Syntax and variants in Basecoat

Button · daisyUI

Change the text, then reset the form. The second button demonstrates a native disabled control. Give unavailable actions an explanation in a real interface.

HTML · compiled output
<div class="fltheme-components">
<form class="fl-demo-row"><input aria-label="Demonstration text" class="du-input" value="Sample text"><button class="du-btn du-btn-primary" type="reset">Reset text</button><button class="du-btn" disabled>Export unavailable</button></form>
</div>

Syntax and variants in daisyUI

Button group · Basecoat

Joined links can express a small group of peer destinations. Each link keeps its own accessible name and focus stop.

HTML · compiled output
<div class="fltheme-components">
<nav aria-label="Reading group" class="button-group"><a class="btn" data-variant="outline" href="../../text/type/">Type</a><a class="btn" data-variant="outline" href="../../text/lists/">Lists</a></nav>
</div>

Syntax and variants in Basecoat

Buttons · MaterialX

MaterialX renders this pattern from Markdown. The source panel contains the actual authoring syntax, including attribute lists where they apply. Keep the renderer extensions enabled on the destination.

HTML · compiled output
<p><a class="md-button" href="https://help.fontlab.com/fontlab/8/">Read the manual</a>
<a class="md-button md-button--primary" href="https://www.fontlab.com/font-converter/">Explore font conversion <span class="twemoji"><svg viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11z"></path></svg></span></a></p>
Markdown · authored source
[Read the manual](https://help.fontlab.com/fontlab/8/){ .md-button }
[Explore font conversion :material-arrow-right:](https://www.fontlab.com/font-converter/){ .md-button .md-button--primary }

Syntax and variants in MaterialX

Fab · daisyUI

A floating action button fits a compact application workspace. Focus the plus control to reveal two real destinations. Absolute positioning keeps the example inside its preview; copied HTML retains that boundary.

HTML · compiled output
<div class="fltheme-components">
<div style="position:relative;min-height:12rem"><div class="du-fab" style="position:absolute;bottom:1rem;right:1rem"><div aria-label="Open reading destinations" class="du-btn du-btn-circle du-btn-primary" role="button" tabindex="0">+</div><a class="du-btn" href="https://help.fontlab.com/fontlab/8/">Manual</a><a class="du-btn" href="https://www.fontlab.com/">Products</a></div></div>
</div>

Syntax and variants in daisyUI

Use .link when an interface fragment needs daisyUI's link treatment. Normal article links already have the house style and do not need the class.

Syntax and variants in daisyUI

Buttons: authoring details

Adding buttons

Use the base treatment for a visible but secondary route.

Read the action guidance

[Read the action guidance](../design/actions.md#button-system){ .md-button }

Adding primary buttons

Add the primary modifier only when this is the page's single main route.

Start reading

[Start reading](https://fontlab.dev/vexy-fontlab-writing-styleguide/fl1992mk/){ .md-button .md-button--primary }

Adding icon buttons

An icon may reinforce the label, but must not replace it.

Continue

[Continue :material-arrow-right:](links.md#daisyui-fab){ .md-button }

Accessibility. Write link text that still makes sense without its visual treatment or icon. Do not apply .md-button to a link whose destination is missing, and do not mix .md-button and .btn on one element.

Compare semantic action colours

Use the role that describes an action, and keep its text label. These buttons reset the sample field so that every enabled control has an observable action. A warning or error colour belongs to that state, not to ordinary emphasis.

Size and weight of an action

Outline and ghost treatments let a secondary action recede. Small and large variants change the control size; preserve a comfortable touch target when using them on a phone. All four controls below reset the same editable field.

Show a busy action

This static specimen represents work in progress. A real application should set aria-busy="true" while its request runs, then restore the enabled action and announce the result. The spinner is decorative because the label says what is happening.