Runs a labeled icon action with automatic async feedback.

longlink docs --component "IconButton"
IconButton [Action]
Props and types
declare function IconButton(props: {
label: string;
icon: ViewNode;
variant?: 'primary' | 'secondary' | 'ghost' | 'destructive';
size?: 'sm' | 'md' | 'lg';
tooltip?: string;
isDisabled?: boolean;
onClick?: (event: ViewMouseEvent) => void | Promise<void>;
}): React.JSX.Element;
function Example() {
return (
<IconButton
label="Refresh"
icon={<Icon icon="refresh" size="sm" />}
onClick={async () => {
await request('/api/refresh', { method: 'POST' });
}}
/>
);
}