Skip to main content
Brand and assets
Build
Monitor and contribute
/
Component library
  • All components
  • Buttons & actions
    • BackButton
    • Button
    • HighlightButton
    • IconButton
    • SemanticButton
  • Forms & inputs
  • Layout & containers
  • Overlays
  • Feedback & status
  • Data display
  • Typography
  • Accessibility
  • Contrib
  • Deprecated
  • Buttons & actions
  • IconButton

IconButton

Button carrying an icon instead of a label. Use where space is tight and the icon is unambiguous; pair it with a Tooltip so the action is still readable.

Health
Component health
Source
View on Github
Design
View Figma
Storybook
View in Storybook
Playground
No Example
Accessibility

partially-compliant

Platform
Universal
Accessibility issues
The component has the same issue as the `Button` component.
  • Overview
  • Props
  • Figma

General guidelines​

IconButton is an ideal option for reducing the amount of actions on a UI, therefore reducing the user's mental clutter. Include a Tooltip to help users who may be unfamiliar with the icon.

✅ When to use❌ When not to use
  • To simplify the appearance of repeated or persistent actions on a page.
  • To enable actions in tables or toolbars.
  • To reduce the amount of actions on a UI.
  • To enable primary and secondary actions - use a Button instead.

Variants​

Sizes​

Accessibility​

The aria-label prop is mandatory for screen readers to announce the button's purpose. This prop is required and cannot be omitted.

To read more about the accessible name, check the Accessible Names documentation.

Playground​

Loading...
tip
This component is universal, its usage is the same in murray and murray/mobile.

IconButton props

NameTypeDefault ValueDescriptionUsage count
disabledbooleanundefinedIndicated disabled state
externalPseudoState"hovered""pressed"undefinedExternally controlled pseudo state for hover/press effects. Use this when the button is wrapped in a component that prevents normal event handling (e.g., Popover triggers with asChild). @internal - Primarily for internal Murray use
hasDropdownArrowbooleanundefinedAdds an arrow on the right. Use when the button triggers a dropdown or similar
hitSlopnumberInsetsnullundefinedDefines how far your touch can start away from the button on mobile @platform mobile
icon
335 possibilities"Card""Menu""Accessible""AlanBlobHappy""AlanBlobHey""AlanBlobNoMouth""AlanBlobOpenMouth""AlanBlobSleeping""AlanLogo""Album""Alert""AlertAlt""Ambulance""AmbulanceSiren""Apple""AppleFilled""ArrowBottomLeft""ArrowBottomRight""ArrowDouble""ArrowDown""ArrowDownAlt""ArrowDropdown""ArrowDropright""ArrowDropup""ArrowLeft""ArrowLeftAlt""ArrowRight""ArrowRightAlt""ArrowTopLeft""ArrowTopRight""ArrowUp""ArrowUpAlt""ArrowUpDown""ArrowsLeftRight""Baby""BabyBottle""Back10""BadgeHeart""Bag""Bandaid""Bank""Bell""BellRinging""Bike""Bills""BirthdayCake""Block""BlurHeavy""BlurLight""BookHeart""Books""BooksAlt""BoxAdd""BoxArrowTopRight""Brain""Bubble""BubbleHeart""BubbleWithDots""Bus""Calculator""Calendar""CalendarClock""Camera""Cards""Carrot""ChatAdd""ChatAddFilled""ChatBubble""ChatDots""Check""CheckAlt""CheckboxActive""CheckboxInactive""Child""Children""Close""CloseAlt""CloudDownload""CloudUpload""Coffee""Company""Copy""Cross""DashboardMenuRight""DashboardMenuRightFilled""Devices""DockToBottom""DockToRight""Doctor""DoctorBag""Document""DocumentHeart""DotMenu""DoubleCheck""Driving""Drop""Dumbbells""Ear""Email""Enterprise""Euro""ExclamationMark""ExitFullscreen""ExternalLink""Eye""EyeOff""EyeOffStroke""FaceId""Facebook""FatArrowRight""FeatherPen""Female""FileUnknown""Filter""Finger""Flag""Flash""FlashDouble""FlashNo""FlashOutline""FlashYes""FlipCamera""Foot""Forward10""FrameProfile""FrameSearch""Fullscreen""Gender""Gift""GiftMind""Glasses""Globe""GlobeEarth""Graph""GraphicEq""Hand""HangUp""Heart""HeartAdd""HeartCheck""HeartStroke""HeartStrokeAdd""Home""HomeHeart""HomeMap""Hospital""HospitalMap""Hourglass""Intercom""Journal""Key""Keyboard""Label""LaptopHealth""Leaves""Levers""Lifebuoy""LightBulb""Link""Linkedin""List""Location""Lock""LockOpen""Lotus""MagnifyingGlass""Mail""Male""Map""MapLocation""Masterclass""MedicalChat""MedicalChatHeart""Medium""MenuDot""Mic""MicOff""Microscope""MindCard""MindInbox""MinusAlt""MobilePhone""Moon""MoonSleepy""MusicOff""MusicOffSingle""MusicOn""MusicOnSingle""NearMe""NewPost""NoFlash""NoSmoking""None""NoteAdd""Notion""PanelLeft""PanelLeftDashed""Paperclip""Paperplane""Pause""Payfit""PeachFilled""Pencil""People""PeopleTwo""PersonAdd""PersonRemove""Phone""PhoneHangUp""PhonePlus""Picture""Piggy""Pill""Pills""Play""Plus""PlusAlt""PrevenirLogo""Printer""Profile""ProfileSettings""Psychology""Quotes""RaisingHands""React""Refresh""Reply""Rotate""RotateBox""RoundedArrowDown""RoundedArrowLeft""RoundedArrowRight""RoundedArrowUp""RoundedCheck""RoundedCross""RoundedEmpty""RoundedExclamationMark""RoundedFull""RoundedHalf""RoundedHelp""RoundedHelpLine""RoundedInfo""RoundedInfoLine""RoundedLess""RoundedPlay""RoundedPlus""RoundedQuarter""RoundedThreeQuarters""RoundedWarning""Ruler""RulerFilled""Save""Scale""ScanBarcode""Screenshare""ScreenshareStop""Seringe""Settings""Share""ShareAndroid""ShareIos""ShareScreen""Shield""ShieldCog""ShieldHeart""Snowflake""SocialFb""SocialFbLine""SocialGoogle""SocialLinkedin""SocialLinkedinLine""SocialTwitter""SocialTwitterLine""Sparkles""Spiral""SplitLeft""SplitRight""SsoGoogle""SsoPsc""Star""Stethoscope""StoreBasket""StrawberryFilled""Subtitles""Subway""Sun""Swipe""Target""ThumbDownStroke""ThumbUpStroke""ThumbsDown""ThumbsUp""Tick""Time""TimeSimple""Tooth""ToothBrace""TouchId""TpCard""Tram""Transmission""TransportationBus""TransportationTrain""Trash""TreeGraph""TriangularExclamationMark""TurtleShell""Twitter""Umbrella""UmbrellaHeart""Undo""VideoCall""VideoHeart""VideoHorizontal""VideoHorizontalOutlined""VideoOff""VideoOn""VideoPlural""VideoVertical""VolumeOff""VolumeOn""VolumeUp""Walking""Wallet""Warning""WarningAlt""Wind""Work""WorkHeart""World""Wrench""X""ZoomIn""ZoomOut"undefined
Adds an icon to the left of the component
isActivebooleanundefinedSets the button in a pressed state.
onMouseEnterundefinedMouseEventHandler<HTMLDivElement>
onMouseLeaveundefinedMouseEventHandler<HTMLDivElement>
onPress
3 possibilities((event: GestureResponderEvent) => void)nullundefined
onPressIn
3 possibilities((event: GestureResponderEvent) => void)nullundefined
onPressOut
3 possibilities((event: GestureResponderEvent) => void)nullundefined
pressedScalenumberundefinedScale multiplier applied on press (e.g., 1.1 for 110% scale). When provided, button will animate scale on press.
progressbooleanundefinedDetermines whether the Loader component should be displayed over the button
renderAs
2 possibilitiesundefined | (props: { children: ReactNode; }) => ReactElement<unknown, stringJSXElementConstructor<any>>
sizeIconButtonSizeundefinedmdControls overall size of the IconButton. `md` by default
successbooleanundefinedDetermines whether a success icon should be displayed over the button
sxPositionPropsundefined
titlestringundefinedTooltip shown on hover (web). Defaults to `aria-label`, so sighted users see what screen readers announce.
type"button""submit""reset"undefined
variantIconButtonVariantundefinedprimaryControls the looks (colors, shadows) of the component

Undocumented props

NameTypeDefault ValueDescriptionUsage count
aria-expandedany
aria-labelany
aria-pressedany
refany

Style API​

Use sx for one-off adjustments. It accepts these style keys:

alignSelfanimationaspectRatiobottomcursordisplayendflexflexBasisflexGrowflexShrinkheightinsetinsetInlineinsetInlineEndinsetInlineStartleftmarginmarginBottommarginHorizontalmarginInlinemarginInlineEndmarginInlineStartmarginLeftmarginRightmarginTopmarginVerticalmatrixmaxHeightmaxWidthminHeightminWidthopacityperspectivepositionrightrotaterotateXrotateYrotateZscalescaleXscaleYskewXskewYstarttoptransformtransformOriginwidthxyzIndex

Each can be overridden per breakpoint with:

$lg$ltLg$ltMd$ltSm$ltVs$ltXl$ltXxl$md$sm$vs$xl$xs$xxl
Edit this page
Previous
HighlightButton
Next
SemanticButton
  • General guidelines
  • Variants
  • Sizes
  • Accessibility
  • Playground