Skip to content

Actions

Action primitives built on the shadcn Button or a plain <button>, imported from @/components/ui/actions. Use them instead of rolling your own spinner button, badge icon button or heart toggle. See also UI Primitives.

A Button that disables itself and shows a spinner (or loadingText) while isLoading is true. Use it for any submit or async action. Icons are dropped while loading.

Source: src/components/ui/actions/LoadingButton.tsx

A square icon-only button with an optional numeric badge or dot, for toolbar and nav icons. label is required and becomes the aria-label.

Source: src/components/ui/actions/IconButton.tsx

A heart toggle with a count, shared by posts and comments. It is purely presentational: the caller owns the liked state and persistence. The count sits in a fixed-width slot so the layout doesn’t shift as the number changes.

Source: src/components/ui/actions/LikeButton.tsx

A flex wrapper with role="group" for laying out related buttons.

Source: src/components/ui/actions/ButtonGroup.tsx