Argent

IconButton

A button that shows only an icon.

import { IconButton } from '@rajatweb/argent'

<IconButton label="Add item" onClick={add}>
  <PlusIcon aria-hidden />
</IconButton>

Props

PropTypeDefaultWhat it does
label requiredstringAccessible name, since the icon alone has none.
disabledboolean
loadingbooleanShows a spinner and ignores presses.
size'sm' | 'md' | 'lg''md'
variant'danger' | 'solid' | 'outline' | 'ghost''solid'

Accessibility

  • `label` is required, because an icon has no name of its own.

Do

  • Use icons people already know.

Don’t

  • Hide a main action behind an icon.