Feedback Components
Components for user feedback, notifications, and interactive overlays.
Status: Stable
Alert
Inline status messages.
import { Alert } from '@gtcx/ui';
<Alert type="success" message="Changes saved successfully" />
<Alert type="warning" message="Your session expires in 5 minutes" />
<Alert type="error" message="Failed to save" description="Please try again" closable />
<Alert type="info" message="New version available" />Dialog
Modal dialog for focused interactions.
import { Dialog } from '@gtcx/ui';
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<Dialog.Trigger>
<Button>Open Dialog</Button>
</Dialog.Trigger>
<Dialog.Content>
<Dialog.Header>
<Dialog.Title>Confirm Action</Dialog.Title>
<Dialog.Description>This action cannot be undone.</Dialog.Description>
</Dialog.Header>
<Dialog.Footer>
<Button variant="outline" onClick={() => setIsOpen(false)}>Cancel</Button>
<Button variant="primary" onClick={handleConfirm}>Confirm</Button>
</Dialog.Footer>
</Dialog.Content>
</Dialog>AlertDialog
Confirmation dialog requiring explicit user action.
import { AlertDialog } from '@gtcx/ui';
<AlertDialog>
<AlertDialog.Trigger>
<Button variant="destructive">Delete</Button>
</AlertDialog.Trigger>
<AlertDialog.Content>
<AlertDialog.Title>Are you sure?</AlertDialog.Title>
<AlertDialog.Description>This will permanently delete the record.</AlertDialog.Description>
<AlertDialog.Cancel>Cancel</AlertDialog.Cancel>
<AlertDialog.Action onClick={handleDelete}>Delete</AlertDialog.Action>
</AlertDialog.Content>
</AlertDialog>Sheet
Slide-out panel from screen edge.
import { Sheet } from '@gtcx/ui';
<Sheet side="right">
<Sheet.Trigger><Button>Open Panel</Button></Sheet.Trigger>
<Sheet.Content>
<Sheet.Header><Sheet.Title>Details</Sheet.Title></Sheet.Header>
<div>Panel content here</div>
</Sheet.Content>
</Sheet>Tooltip
Hover information overlay.
import { Tooltip } from '@gtcx/ui';
<Tooltip content="Copy to clipboard">
<Button variant="ghost" size="icon"><CopyIcon /></Button>
</Tooltip>Popover
Click-triggered content overlay.
import { Popover } from '@gtcx/ui';
<Popover>
<Popover.Trigger><Button>Settings</Button></Popover.Trigger>
<Popover.Content>
<p>Popover content</p>
</Popover.Content>
</Popover>HoverCard
Rich preview on hover.
import { HoverCard } from '@gtcx/ui';
<HoverCard>
<HoverCard.Trigger>@janedoe</HoverCard.Trigger>
<HoverCard.Content>
<Avatar src="/jane.jpg" />
<p>Jane Doe — Product Manager</p>
</HoverCard.Content>
</HoverCard>Accordion
Collapsible content sections.
import { Accordion } from '@gtcx/ui';
<Accordion type="single" collapsible>
<Accordion.Item value="faq-1">
<Accordion.Trigger>What is Ledger UI?</Accordion.Trigger>
<Accordion.Content>A design system built on React and Ant Design.</Accordion.Content>
</Accordion.Item>
</Accordion>Progress
Progress bar indicator.
import { Progress } from '@gtcx/ui';
<Progress value={65} />
<Progress value={100} status="success" />Toast
Ephemeral notification.
import { toast } from '@gtcx/ui';
toast.success('Record saved');
toast.error('Failed to delete');
toast.info('New update available');Accessibility Notes
- Ensure dialogs trap focus and restore it on close.
- Provide descriptive titles for alerts and dialogs.
- Use
aria-livefor toast notifications when needed.
Tokens to Customize
colorErrorcolorWarningcolorInfo