IconButton
IconButton
is a component that displays an icon within a button.
Import
import { IconButton } from "@yamada-ui/react"
Usage
Editable example
<IconButton icon={<Plus />} />
Change Variant
Editable example
<Wrap gap="md"> <IconButton colorScheme="primary" variant="primary" icon={<Plus />} /> <IconButton colorScheme="secondary" variant="outline" icon={<Minus />} /> <IconButton colorScheme="warning" variant="ghost" icon={<Sun />} /> <IconButton colorScheme="danger" variant="link" icon={<Moon />} /> <IconButton variant="unstyled" icon={<Check />} /> </Wrap>
Change Size
Editable example
<Wrap gap="md"> <IconButton colorScheme="primary" size="xs" icon={<Plus />} /> <IconButton colorScheme="secondary" size="sm" icon={<Minus />} /> <IconButton colorScheme="warning" size="md" icon={<Sun />} /> <IconButton colorScheme="danger" size="lg" icon={<Moon />} /> </Wrap>
Disable
To disable, set isDisabled
to true
.
Editable example
<Wrap gap="md"> <IconButton isDisabled colorScheme="primary" variant="primary" icon={<Plus />} /> <IconButton isDisabled colorScheme="secondary" variant="outline" icon={<Minus />} /> <IconButton isDisabled colorScheme="warning" variant="ghost" icon={<Sun />} /> <IconButton isDisabled colorScheme="danger" variant="link" icon={<Moon />} /> <IconButton isDisabled variant="unstyled" icon={<Check />} /> </Wrap>
Edit this page on GitHub