From 3f775f54db60fc40c5187d038fe7c21d1dc59dfa Mon Sep 17 00:00:00 2001 From: Erin Donehoo <105813956+edonehoo@users.noreply.github.com> Date: Tue, 27 May 2025 10:55:43 -0400 Subject: [PATCH] docs(button): Adds more guidance for link button usage. --- .../components/button/button.md | 43 ++++++++++++++---- .../button/img/default-link-style.svg | 15 ++++++ .../components/button/img/external-links.svg | 10 ++++ .../components/button/img/external_links.png | Bin 2112 -> 0 bytes .../button/img/inline-link-in-text.svg | 7 +++ .../button/img/inline-link-styles.svg | 31 +++++++++++++ 6 files changed, 96 insertions(+), 10 deletions(-) create mode 100644 packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/img/default-link-style.svg create mode 100644 packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/img/external-links.svg delete mode 100644 packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/img/external_links.png create mode 100644 packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/img/inline-link-in-text.svg create mode 100644 packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/img/inline-link-styles.svg diff --git a/packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/button.md b/packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/button.md index fab7c6f3e5..74f38ed549 100644 --- a/packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/button.md +++ b/packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/button.md @@ -94,13 +94,33 @@ Links buttons are labeled buttons with no background or border. Link buttons can * Navigate users to another page within the same window. * Navigate users to an external page. -While all link buttons lack borders, they can still vary in appearance. Link buttons that navigate users to another page within the same window should be presented as stand-alone text. Link buttons that navigate users to an external page may include an icon on the left or right of the text to further emphasize the action. For example, you could add an external link icon to show that clicking on it will navigate users externally to another website or application. +While all link buttons lack borders, they can still vary in appearance. + +#### External links + +Link buttons that navigate users to another page within the same window should be presented as stand-alone text. + +Links that navigate users to an external page should include an external link icon beside the text to show that clicking on it will bring users to another website or application. + +This is the recommendation for both default and inline links:
- Example of link button with icon on the left and the right + ![External link icons, both with default and inline links. The external link icon displays an arrow, coming out of a box, towards the top right.](./img/external-links.svg)
-You might use a link button instead of a secondary button format to create greater visual hierarchy between two buttons. Examples include using text buttons as cancel buttons in modals or wizards, as well as for secondary actions in empty states. +#### Default link buttons + +Default link buttons have no default background or border, but do have a hover background to indicate the clickable area. + +
+ ![A default link button, before and after being hovered. Before hover, there is no background style. After hover, there is a light gray background that fills the clickable area.](./img/default-link-style.svg) +
+ +##### When to use default links + +Use default link buttons for actions that do not require the visual emphasis of a standard button, or when a link will be placed alongside other buttons and should match the spacing. + +For example, the ‘Cancel’ button in modals or links within an empty state. _Example of a link button in a modal_ @@ -114,20 +134,22 @@ _Example of link buttons in an empty state_ Example of link buttons in an empty state -### When to use - -Always use link buttons in the following cases: +#### Inline links -* For cancel buttons in wizards or modals +Inline links are styled with a persistent underline, to indicate that they are clickable. When users hover over an inline link, the color changes from `global/text/color/link/default` to `global/text/color/link/hover`, which is darker. Once a link is clicked, the text color becomes `global/text/color/link/visited`.
- Example of link button used in modal + ![Possible styles for different inline links and their states. A default state, with a standard blue text inline link and a link with an external link icon. Hover versions for both inline links, which are slightly darker in text color. Links that have already been visited, which makes the text purple.](./img/inline-link-styles.svg)
-* For more actions in empty states +##### When to use inline links + +Inline link buttons are to be used for links placed within text content. If a link will take users to a different window or application, use an external icon link. + +* Within text content
- Example of a link button in an empty state + ![An inline link in the middle in the middle of a short sentence.](./img/inline-link-in-text.svg)
* For action buttons in tables @@ -142,6 +164,7 @@ Always use link buttons in the following cases: Example of link button in an alert + ### Icon button ### Icon buttons are useful in places where space is limited. For example, if you have too many actions within a menu, you could use a kebab icon to indicate more actions, or an export icon for exporting data. You can also use this button type for actions that are commonly associated with icons, like an exit icon to close a window or a hamburger icon to open a menu. diff --git a/packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/img/default-link-style.svg b/packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/img/default-link-style.svg new file mode 100644 index 0000000000..036615ab7d --- /dev/null +++ b/packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/img/default-link-style.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/img/external-links.svg b/packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/img/external-links.svg new file mode 100644 index 0000000000..0b303d3ba0 --- /dev/null +++ b/packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/img/external-links.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/img/external_links.png b/packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/img/external_links.png deleted file mode 100644 index 00830df02b55d2c50bcedd75f4f8061e3abbefe4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2112 zcmcJQ`#;l*AICq4Q^@JEsR${H(>N|sI2f|n)ZDLg3*VVxGMAD2B#DT%3hkT7rDPM^ za!nmNPA4nNWim6DE{0rIXy$VCc$~-i3%=hU-j~<=@qRyEzq}uhXRb5Kez&}eJOBW@ z5e{~)03gNK?vXp?wsSx4e%W@}bKG_!}XFuV?fJe-pt1A^f zcih7DY2Q5M5m@2*U{sYhxz4h7+6CQ#)vwx%%(IPgv~$^)tFsII@=bK(LIS^cPB7Q| z+d>L#k3&Kj5z}?@?bmrp7=~Y$Aq5U~kjZ&)CKa`Gw8M%%>_kRB<(Tk2o*Sdg=?ejKrQ{uUX`D$Z(#ePW> zEhVj@KYPc}Mpdz~6CoWARwHk_t0b79{xXaxaq1b7dh_II<#UGLw~BW1;eIWUI`J!T z3l!Ub`ZL?tWf20_m4DOxoU&gd%CLs?pmK_{%W&U%#}MBRc^o$w5y-C1ei+r0HFc%! zD)ecn39RKPk!(Al5;Y`RV!@aut#~Rn4QWf$ z&d&dNVdqayJn#YC8R-^Ni5Al;0z$=2mZamaWu?kZE5}fj1R}S6cRmhRHwSS{yA%70 z2gj32Wu7EF!e5x3^*2iJm7)+hfw@v|TE6N2HiO!NZW=6Cey*{XpIEwo@*mHeJLG-ye0M2BEqn^JpGpVT*O#akc1`u?)@1lY zagffnrLILHwHvt)H}PLf7jI_0`coN6Df3jC*rp4=AHvM4iOzXtpGy#Z4~i$*ns&|4 zbX|0oG-+%q!Q4ha$g17ObnrJevv74jbZ)2|^MfOdZ4y~@OeKawZ6=t(Ai1O=QUa;U z>v!b~k8H?}B?XP^Eu_4bYmv##Fdc7}%9uSeCI@t5g`*dfFeo?|-OAX-bgrzC9Ubz*B2_D5( zy$=7+HIZ1K`0}{pMj>60#%kQu8MeY{3N!i9FXumZZxYW5N8d&8-M(wYP`)%*-03JF z4P`jKAjCzdhZ6HWc$5mVF>O#N&%{$w2KfED2wY696@gA5u=DSJm;GPHMp^Gr?kvaJou-*>~cx5^KPeQ}6k5_*u zD}icN4(_J>rh{41!NxbL>oWZ{KPC~mrQf`&T_Pf@OSCC?wR$OA^Q+L)&b=xjiuGq} zUR3x5Z@HsHMH^^0HB-93fzNQO;iPy-zrNqmepTs?OOuh%8qvsU?#=!y3T6B$Gj5NU z@T(?lSw+x?iyIMf1_T$Q&Mj7kw}+QL^2=wWMX{49T5%Je>y{10hsQlDIEJ`;`*+jK zyxN9W9G0T8{=Jv2Kf4iS-1yBTK+o0x-5)ITSy-MgZRJu*&55Vd57Sczrd&o2*>TUy zO<@zL1&EW=18e!_$MtT2Q`MEvY8N&W>~DQ_bDbtUzL0fBJ2T=%h4LbkzI8PPA0vh{ z!H?tNAzceJ9Ab6{*Q5VSz4guVNF!H*v(X{dF^++Fc>b`zQ?!7XekGkZ%Nq<#I@10a z)pyig)CWGq82ZI;&No&A3Mp*%VoxCxQr} z{Lh^p=?mXh6cO!V^!Kv0NY|KE_iL40;c`Xjz;wb + + + + + + diff --git a/packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/img/inline-link-styles.svg b/packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/img/inline-link-styles.svg new file mode 100644 index 0000000000..85d145e4e4 --- /dev/null +++ b/packages/documentation-site/patternfly-docs/content/design-guidelines/components/button/img/inline-link-styles.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +