Icon

Icon, a React Native component for iOS, Android and web: A tinted Feather icon, or your own single-color artwork.

Usage

import { useTheme } from '@leoanimesh/ferrule';
import { Icon } from './components/ui/icon';
import { Stack } from './components/ui/stack';

export default function Example() {
  const { colors } = useTheme();
  return (
    <Stack direction="horizontal" gap={3} align="center">
      <Icon name="map-pin" />
      <Icon name="map-pin" size={28} color={colors.primary} />
      <Icon name="star" size={28} color={colors.warning} label="Rated" />
    </Stack>
  );
}

Props

PropTypeDefaultDescription
nameFeatherNameA Feather icon, such as `search`. A wrong name fails typecheck. Browse them in the docs.
sourceImageSourcePropTypeYour own artwork instead: a single-color PNG with alpha. Only its shape is used.
sizenumber20
colorstringDefaults to the theme's text color.
labelstringWhat the icon means, when nothing else says it. Without one, screen readers skip it.
flipbooleanname ? isDirectional(name) : falseMirrors in right-to-left. On by default for Feather's arrows, chevrons, corners and log-in and log-out.
styleStyleProp<ImageStyle>
testIDstring