Icon buttons help people take supplementary actions with a single tap. They are used when a compact button is required, such as in app bars, toolbars, and search containers.
Import the IconButton component from react-native-materia and provide a valid icon name or component:
import { IconButton } from "react-native-materia";
export const Example = () => (
<IconButton
icon="settings-outline-rounded"
onPress={() => console.log("Pressed")}
/>
);Icon buttons come in four distinct modes to represent different emphasis levels within an interface.
High-emphasis icon button with a solid background fill for prominent actions.
<IconButton mode="filled" icon="check-rounded" />Medium-high emphasis icon button with a softer tonal background fill.
<IconButton mode="tonal" icon="check-rounded" />Medium-emphasis icon button with an outline border and transparent fill.
<IconButton mode="outlined" icon="check-rounded" />Low-emphasis icon button with a transparent surface, ideal for toolbars and compact actions.
<IconButton mode="standard" icon="check-rounded" />Icon buttons reflect different interaction states, such as disabled when an action is unavailable, or loading when an operation is processing.
<IconButton mode="filled" icon="check-rounded" disabled />
<IconButton mode="filled" icon="check-rounded" loading />The IconButton component accepts the following properties:
IconSource
Specifies the icon to display inside the button. Accepts a built-in icon name string, a custom React component, or an SVG component. Refer to the Iconography guide for details.
IconButtonMode
Defines the visual appearance and emphasis level of the button. Accepts "filled", "tonal", "outlined", or "standard".
Default value: "standard"
boolean
Replaces the icon with an activity indicator and disables user interaction.
Default value: false
boolean
Disables button interaction and applies disabled styling.
Default value: false
StyleProp<ViewStyle>
Custom view styles applied to the outer container.
In addition to the component-specific props above, IconButtonProps extends Omit<PressableProps, "style">, providing full support for standard React Native touch events and accessibility attributes such as onPress, onLongPress, testID, and accessibilityLabel.
Type definitions associated with the IconButton component:
Union type representing the available visual modes for the icon button.
type IconButtonMode = "filled" | "tonal" | "outlined" | "standard";Interface defining all props accepted by the IconButton component.
interface IconButtonProps extends Omit<PressableProps, "style"> {
icon: IconSource;
mode?: IconButtonMode;
loading?: boolean;
disabled?: boolean;
style?: StyleProp<ViewStyle>;
}Internal styling configuration computed based on the active mode, theme colors, and interaction states.
interface IconButtonStyleConfig {
backgroundColor: string;
iconColor: string;
borderColor: string;
}