Alok Srivastava

Astryx Alert Dialog

Forms

About

A modal confirmation dialog from Meta's Astryx design system for destructive or high-impact actions.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Astryx Alert Dialog to your project and fits it to your theme.

Code

How Astryx Alert Dialog is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

'use client';

import {useState} from 'react';
import {AlertDialog} from '@/components/ui/astryx-alert-dialog';

function AlertDialogAsyncAction() {
  const [isLoading, setIsLoading] = useState(false);

  return (
    <AlertDialog
      isOpen
      isInline
      onOpenChange={() => {}}
      title="Revoke access?"
      description="This user will immediately lose access to all shared resources."
      actionLabel="Revoke"
      isActionLoading={isLoading}
      onAction={async () => {
        setIsLoading(true);
        await new Promise(r => setTimeout(r, 2000));
        setIsLoading(false);
      }}
    />
  );
}

export default function AlertDialogAsyncActionDemo() {
  return (
    <div
      data-astryx-theme="neutral"
      data-theme="light"
      style={{colorScheme: 'light', display: 'contents'}}>
      <AlertDialogAsyncAction />
    </div>
  );
}

Dependencies

More by Alok Srivastava

View all
  • Glossy Slider Call Button

    Glossy Slider Call Button

    21
  • Dot Graph Card

    Dot Graph Card

    20
  • Profile Menu Expander

    Profile Menu Expander

    2
  • Astryx Base Typeahead

    Astryx Base Typeahead

    1
  • Pixel Perfect Command Palette

    Pixel Perfect Command Palette

    1
  • Astryx Center

    Astryx Center

  • Expandable Book Search Palette

    Expandable Book Search Palette

More in Forms

View all
  • Contact Card

    Contact Card

    1.1K
  • Premium Auth

    Premium Auth

    551
  • Login 1

    Login 1

    60
  • Form

    Form

    17
  • Form

    Form

    16
  • Book A Demo 1

    Book A Demo 1

    84
  • Card Studio

    Card Studio

    46
  • Login 2

    Login 2

    10