Select to view content in your preferred language

Calcite button: space between text and icon

471
3
Jump to solution
11-01-2024 02:18 PM
lmarun
by
Occasional Contributor

I'd like to create a space between the text and a calcite icon in a button. I do not want that space underlined. I've made several attempts, but am having no luck. 

Please my code below and an image of the result.

button_icon.png

<a class="btn btn-primary" href="https://webpage.com/" role="button" target="_blank">Website<calcite-icon icon="launch-2" text-label="external link" aria-hidden="false" aria-label="external link" role="img" scale="s" alignment="icon-start-space-between" calcite-hydrated=""></calcite-icon></a>

Tags (3)
0 Kudos
2 Solutions

Accepted Solutions
JenniferAcunto
Esri Regular Contributor

<a class="btn btn-primary" href="https://webpage.com/" role="button" target="_blank">Website<calcite-icon icon="launch-2" style="margin-left: 3px;" text-label="external link" aria-hidden="false" aria-label="external link" role="img" scale="s" alignment="icon-start-space-between" calcite-hydrated=""></calcite-icon></a>

JenniferAcunto_0-1730749089032.png

 

- Jen

View solution in original post

BrianRollison
Esri Contributor

@lmarun you will get this spacing right out of the box using a calcite button within the Text Card, you can use the Calcite Components explorer to play around with styling and simply copy/paste into your Text Card's HTML editor: https://developers.arcgis.com/calcite-design-system/components/button/.

At a high-level the basic visual props would be <calcite-button icon-end="launch">Website</calcite-button>.

View solution in original post

3 Replies
JenniferAcunto
Esri Regular Contributor

<a class="btn btn-primary" href="https://webpage.com/" role="button" target="_blank">Website<calcite-icon icon="launch-2" style="margin-left: 3px;" text-label="external link" aria-hidden="false" aria-label="external link" role="img" scale="s" alignment="icon-start-space-between" calcite-hydrated=""></calcite-icon></a>

JenniferAcunto_0-1730749089032.png

 

- Jen
BrianRollison
Esri Contributor

@lmarun you will get this spacing right out of the box using a calcite button within the Text Card, you can use the Calcite Components explorer to play around with styling and simply copy/paste into your Text Card's HTML editor: https://developers.arcgis.com/calcite-design-system/components/button/.

At a high-level the basic visual props would be <calcite-button icon-end="launch">Website</calcite-button>.

lmarun
by
Occasional Contributor

@BrianRollison and @JenniferAcunto, thank you for both of these great options!

0 Kudos