G
Tokens
TypographySpacingColorRadiusShadowMotion

IconButton

Icon


    <Arrange>
      <IconButton icon={<IconHeart />}/>
      <IconButton icon={<IconPlus />}/>
      <IconButton icon={<IconSwitch />}/>
    </Arrange>
  

Active


    () => {
      const [activeDevice, setActiveDevice] = React.useState('desktop');
      return (
        <Arrange>
          <IconButton
            icon={<IconMonitor />}
            isActive={activeDevice === 'desktop'}
            onClick={() => setActiveDevice('desktop')}
          />
          <IconButton
            icon={<IconPhone />}
            isActive={activeDevice === 'phone'}
            onClick={() => setActiveDevice('phone')}
          />
        </Arrange>
      );
    }
  

Variant


    <Arrange>
      <IconButton variant="neutral" icon={<IconFolder />}/>
      <IconButton variant="danger" icon={<IconTrash />}/>
    </Arrange>
  

Disabled


    <Arrange>
      <IconButton icon={<IconArrowLeft />} isDisabled/>
      <IconButton icon={<IconArrowRight />}/>
    </Arrange>
  

Click


    <IconButton icon={<IconPlus />} onClick={() => alert('Nice')}/>
  

Tag


    <Arrange gap="s">
      <IconButton icon={<IconPlus />} onClick={() => console.log('clicked')}/>
      <IconButton icon={<IconPlus />} tag="a" href="https://flodesk.com" target="_blank"/>
      <IconButton icon={<IconPlus />} tag="span"/>
    </Arrange>
  

Props

Name
Type
Default
variant
oneOf
'neutral' 'danger'
'neutral'
type
oneOf
'button' 'submit' 'reset'
'button'
tag
oneOf
'button' 'a' 'span'
'button'
children
node
icon
node
onClick
func
isDisabled
bool
isActive
bool