# Icon

> Cherry Icon component - renders any Lucide icon by name with color, size, and accessibility control.

Source: https://cherry.al/code/icon

> For the complete documentation index, see [llms.txt](https://cherry.al/llms.txt).

# Icon

The Icon component renders any icon from the [Lucide](https://lucide.dev) icon set by name. It is the same component Cherry uses internally (for example in Dropzone tiles and the Modal close button), and it powers the `$icon` props on components like Dropzone and AvatarDropzone.

For design guidelines and all interactive states, see the [Icons](/icons) design page.

```jsx
import React from "react";
import { Icon } from "cherry-styled-components";

export default function Page() {
  return <Icon name="Cherry" size={24} />;
}
```

Icons are decorative by default: without an `aria-label` they render with `aria-hidden`, so screen readers skip them. Pass an `aria-label` to make an icon meaningful; it then gets `role="img"` and the label is announced:

```html
<Icon name="TriangleAlert" color="#ef4444" aria-label="Warning" />
```

If the given name does not match a Lucide icon, the component renders nothing.

## Properties

<Field value="name" type="IconProps" required>
  Name of the Lucide icon to render, e.g. `"Cherry"` or `"FileUp"`. The exported `IconProps` type is the string union of all Lucide icon names.
</Field>

<Field value="color" type="string">
  Icon color. Defaults to the inherited text color.
</Field>

<Field value="size" type="number">
  Icon size in pixels. Defaults to `24`, from Lucide's default attributes.
</Field>

<Field value="className" type="string">
  Class name applied to the rendered SVG.
</Field>

<Field value="aria-label" type="string">
  Accessible label. When set, the icon gets `role="img"` and is announced by screen readers; when omitted, the icon is `aria-hidden`.
</Field>

## Internal usage

Cherry renders this same `Icon` component inside its own form controls, so their glyphs stay consistent with any icons you add yourself: the checkbox check mark in [Input](/code/input) uses `Check`, the dropdown arrow in [Select](/code/select) uses `ChevronDown`, and the calendar glyph on date and time inputs uses `CalendarDays`. These are colored with the theme's primary color through CSS (`currentColor`), so they follow the active palette in light and dark mode.

<Button href="https://github.com/cherry-design-system/styled-components/blob/main/src/lib/icon.tsx" icon="code" iconPosition="left">
  View Source
</Button>
