LogoLogo
GitHub repository
GitHub repository
    Documentation
  • Overview
  • Getting Started
  • Guides


  • Hooks

  • Components


    • AsyncButton
    • AsyncIconButton
    • CodeBlock
    • CopyButton
    • Enumeration
    • ExampleCard
    • Icon
    • InlineCode
    • Logo
    • PageLoadingIndicator
    • PageOverview
    • Paragraph
    • QuoteBlock
    • SmartImage
    • SmartLink
    • StyleLink

AsyncIconButton

An icon button that is automatically disabled after being clicked, until the async action is complete.

Props

The same as Joy UI's IconButton component, except for the following:
  • onClick can be an async function.

Examples

Icon Button that loads for a few seconds


1<AsyncIconButton
2 variant="outlined"
3 onClick={async () => {
4 await wait(5_000);
5 alert("You waited 5 seconds!");
6 }}
7>
8 <Icon icon="alarm" />
9</AsyncIconButton>
1<AsyncIconButton
2 variant="outlined"
3 onClick={async () => {
4 await wait(5_000);
5 alert("You waited 5 seconds!");
6 }}
7>
8 <Icon icon="alarm" />
9</AsyncIconButton>

See also


LogoLogo