Skip to main content

IconButton

Icon buttons help people take supplementary actions with a single tap. Follows the Material Design 3 Icon Button specification.

Usage

import { IconButton } from '@onlynative/components/icon-button'

<IconButton
icon="heart-outline"
accessibilityLabel="Favorite"
onPress={() => {}}
/>

Variants

VariantUse case
filledHigh emphasis, filled container
tonalMedium emphasis, tonal container
outlinedMedium emphasis, outlined border
standardLow emphasis, no container

Sizes

<IconButton icon="star" size="small" accessibilityLabel="Star" />
<IconButton icon="star" size="medium" accessibilityLabel="Star" />
<IconButton icon="star" size="large" accessibilityLabel="Star" />

Toggle Mode

Use selected and selectedIcon for toggle behavior:

const [liked, setLiked] = useState(false)

<IconButton
icon="heart-outline"
selectedIcon="heart"
selected={liked}
onPress={() => setLiked(!liked)}
accessibilityLabel={liked ? 'Unlike' : 'Like'}
/>

Props

No props found for IconButton.