IconButton

An icon button element which supports multiple sizes and colors.

import React from 'react';
import { IconButton } from '@minddrop/ui';
export const IconButtonDemo = () => (
<div style={{ display: 'flex', alignItems: 'center' }}>
<IconButton icon="settings" label="Settings" color="contrast" />
</div>
);
export default IconButtonDemo;

Features

  • Supports icons from the MindDrop icon set.
  • Two size options.
  • Three color options.
  • Label for accessibility.

Import the component from the @minddrop/ui package.

import { IconButton, Icon } from '@minddrop/ui';
export default () => {
return <IconButton icon="close" label="Close" />;
};

IconButtonProps extends React.HTMLAttributes<HTMLButtonElement>.

PropTypeDefault
iconIconNameNo default value
childrennodeNo default value
color'neutral' | 'light' | 'contrast''neutral'
asReact.ElementTypebutton
disabledbooleanNo default value
labelstringNo default value
size'small' | 'medium''medium'

Adheres to the Button WAI-ARIA design pattern.

KeyDescription
SpaceActivates the button.
EnterActivates the button.