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
Source
Design
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 |
|---|---|
|
|
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
| Name | Type | Default Value | Description | Usage count |
|---|---|---|---|---|
| disabled | booleanundefined | Indicated disabled state | ||
| externalPseudoState | "hovered""pressed"undefined | Externally 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 | ||
| hasDropdownArrow | booleanundefined | Adds an arrow on the right. Use when the button triggers a dropdown or similar | ||
| hitSlop | numberInsetsnullundefined | Defines 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 | ||
| isActive | booleanundefined | Sets the button in a pressed state. | ||
| onMouseEnter | undefinedMouseEventHandler<HTMLDivElement> | |||
| onMouseLeave | undefinedMouseEventHandler<HTMLDivElement> | |||
| onPress | 3 possibilities((event: GestureResponderEvent) => void)nullundefined | |||
| onPressIn | 3 possibilities((event: GestureResponderEvent) => void)nullundefined | |||
| onPressOut | 3 possibilities((event: GestureResponderEvent) => void)nullundefined | |||
| pressedScale | numberundefined | Scale multiplier applied on press (e.g., 1.1 for 110% scale). When provided, button will animate scale on press. | ||
| progress | booleanundefined | Determines whether the Loader component should be displayed over the button | ||
| renderAs | 2 possibilitiesundefined | (props: { children: ReactNode; }) => ReactElement<unknown, stringJSXElementConstructor<any>> | |||
| size | IconButtonSizeundefined | md | Controls overall size of the IconButton. `md` by default | |
| success | booleanundefined | Determines whether a success icon should be displayed over the button | ||
| sx | PositionPropsundefined | |||
| title | stringundefined | Tooltip shown on hover (web). Defaults to `aria-label`, so sighted users see what screen readers announce. | ||
| type | "button""submit""reset"undefined | |||
| variant | IconButtonVariantundefined | primary | Controls the looks (colors, shadows) of the component |
Undocumented props
| Name | Type | Default Value | Description | Usage count |
|---|---|---|---|---|
| aria-expanded | any | |||
| aria-label | any | |||
| aria-pressed | any | |||
| ref | any |
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