Skip to main content

Action Button
Ready

The action button is used internally in duet-pagination, duet-date-picker and duet-editable-table

The action button should be used to signify small round buttons that can be clicked to invoke UI actions

Examples

Open in new window
<duet-layout center>
<div slot="main">
<duet-card heading="Default action button">
<duet-action-button></duet-action-button>

</duet-card>
</div>
</duet-layout>
<script>
const actionBN = document.querySelector('duet-action-button');


actionBN.addEventListener('duetActionEvent', (e) => {
console.log(e.detail);
});


</script>
Open in new window
<duet-layout center>
<div slot="main">
<duet-card heading="Coloured action buttons with callback features">
<duet-action-button
action-name="go-back"
action-meta="{some:'string'}"
action-id="foobar2000"
>
</duet-action-button>
<duet-action-button disabled></duet-action-button>
<duet-divider></duet-divider>
<duet-action-button background="danger" name="category-personal" color="gray-lightest"></duet-action-button>
<duet-action-button
disabled
background="danger"
name="category-personal"
color="gray-lightest"
>
</duet-action-button>

</duet-card>
</div>
</duet-layout>
<script>
const actionBN = document.querySelectorAll('duet-action-button');


actionBN.forEach(item=>{
item.addEventListener('duetActionEvent', (e) => {
console.log(e.detail);
});
})


</script>

Properties #

Property Attribute Description Type Default
actionId action-id Name of id of action that was called being called string undefined
actionMeta action-meta Name of id of action that was called being called string | { [x: string]: any; } undefined
actionName action-name Name of action being called string "default-action"
ariaControls accessible-controls Used to indicate which dom element with ID this element controls string ""
ariaDescribedBy accessible-described-by Described By id string undefined
ariaDescription accessible-description Aria description the button string undefined
ariaLabels -- Default pagination labels { [x: string]: string; } getLocaleString( this.ariaLabelsDefaults )
ariaLabelsDefaults -- Default pagination labels DuetLangObject { en: { label: "Click to activate action", }, fi: { label: "Klikkaa toiminnon aktivointiin", }, sv: { label: "Klicka för att aktivera åtgärd", }, }
background background Custom color to be used for a background, as a design token entered in camelCase or kebab-case. Using this option the icon will always be resized to $size-icon-medium on mobile viewports. Example: "color-primary". string ""
color color Custom color to be used for the icon, as a design token entered in camelCase or kebab-case. Example: "color-primary". This property can also be set to "currentColor" which forces the icon to use the CSS text color of parent element instead. Useful when you want to control the color in stylesheet instead. string ""
disabled disabled Disables the button boolean false
iconColor icon-color Color of the icon to display string "currentColor"
iconName icon-name Name of the icon to display string "action-arrow-left-small"
iconSize icon-size Size of the icon "small" | "x-small" | "xx-small" "xx-small"
theme theme Theme of the pagination. "" | "default" | "turva" ""

Events #

Event Description Type
duetActionEvent Emitted a page selection has been made CustomEvent<{ originalEvent?: Event; component: "duet-action-button"; action: string; name?: string; id?: string; index?: string; meta?: string | Record<any, any>; }>

Shadow Parts #

Part Description
"button"
"icon"

Usage #

This section includes guidelines for designers and developers about the usage of this component in different contexts.

When to use #

  • To give a user a button to click, in order to perform an action, this button is always round, and always inconspicuous - if you need larger buttons use the duet-button instead

When not to use #

  • For navigation purposes

Accessibility #

This component has been validated to meet the WCAG 2.1 AA accessibility guidelines. You can find additional information regarding accessibility of this component below.


Integration

For integration, event and theming guidelines, please see Using Components. This documentation explains how to implement and use Duet’s components across different technologies like Angular, React or Vanilla JavaScript.



Tutorials

Follow these practical tutorials to learn how to build simple page layouts using Duet’s CSS Framework, Web Components and other features:

Tutorials

Building Layouts

Tutorials

Using CLI Tools

Tutorials

Creating Custom Patterns

Tutorials

Server Side Rendering

Tutorials

Sharing Prototypes

Tutorials

Usage With Markdown

Tutorials

Zeplin


Troubleshooting

If you experience any issues while using a component, please head over to the Support page for more guidelines and help.