Template: UI/button: Difference between revisions

From Miniscope
Jump to: navigation, search
No edit summary
SchemaSync: sync from repo @ cef7b4698b6a7bf05768b7fe97b5c01c55c4b039
 
Line 15: Line 15:
* <code>primary</code> (default) — main call-to-action on a page
* <code>primary</code> (default) — main call-to-action on a page
* <code>secondary</code> — supporting CTA that shouldn't compete with the primary
* <code>secondary</code> — supporting CTA that shouldn't compete with the primary
For "+ Create new …" affordances on dashboards, use this template directly with the default (primary) style and a label that starts with <code>+ </code>:
  <code><nowiki>{{UI/button|page=Form:Submission|label=+ Create new submission}}</nowiki></code>


Parameters:
Parameters:

Latest revision as of 13:08, 2 May 2026

Renders a styled button-link. Supports both internal wiki page links and external URLs, with primary and secondary visual variants.

All styling lives in MediaWiki:Common.css under the .wiki-button class — change there to update every button across the wiki. This template is just structure: it picks the right link syntax (internal vs. external) and emits the right class names.

Use page for internal links (e.g. Special:RequestAccount), or url for external links (e.g. a Brevo subscribe form). Provide exactly one. If both are set, url wins.

The style parameter chooses the visual treatment:

  • primary (default) — main call-to-action on a page
  • secondary — supporting CTA that shouldn't compete with the primary

For "+ Create new …" affordances on dashboards, use this template directly with the default (primary) style and a label that starts with + :

 {{UI/button|page=Form:Submission|label=+ Create new submission}}

Parameters:

  • page — internal wikilink target (mutually exclusive with url)
  • url — external URL (mutually exclusive with page)
  • label — button text (required)
  • styleprimary or secondary (default: primary)