# Rating (UI SDK): Custom icon

> Pass your own icon as the child of `RatingItem` and switch it with `data-filled`. `tone` sets the color.

Canonical: https://hextaui.com/docs/ui-sdk-rating/examples/custom-icon

Component docs: https://hextaui.com/docs/ui-sdk-rating

## Add this example

```bash
npx shadcn@latest add https://hextaui.com/r/ui-sdk-rating-custom-icon.json
```

This adds `components/examples/ui-sdk-rating/custom-icon.tsx` with the Rating component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/ui-sdk-rating/custom-icon.tsx"
import { IconHeart, IconHeartFilled } from "@tabler/icons-react"

import { Rating, RatingItem } from "@/components/ui/ui-sdk-rating"

function UiSdkRatingCustomIcon() {
  return (
    <Rating
      aria-label="How much did you like it?"
      defaultValue={3}
      tone="destructive"
    >
      <RatingItem>
        <IconHeart
          aria-hidden="true"
          className="size-6 group-data-[filled]/rating-item:hidden group-data-[partial]/rating-item:hidden"
        />
        <IconHeartFilled
          aria-hidden="true"
          className="hidden size-6 group-data-[filled]/rating-item:block group-data-[partial]/rating-item:block"
        />
      </RatingItem>
    </Rating>
  )
}

export { UiSdkRatingCustomIcon }
```

## Props in this example

### Rating

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultValue` | `number \| null` | – |  |
| `tone` | `"default" \| "neutral" \| "destructive"` | `"default"` |  |

## More Rating examples

- [Half stars](https://hextaui.com/docs/ui-sdk-rating/examples/half)
- [Read-only](https://hextaui.com/docs/ui-sdk-rating/examples/read-only)
- [Sizes](https://hextaui.com/docs/ui-sdk-rating/examples/sizes)
- [Deselectable](https://hextaui.com/docs/ui-sdk-rating/examples/deselectable)
- [Controlled](https://hextaui.com/docs/ui-sdk-rating/examples/controlled)
- [Form](https://hextaui.com/docs/ui-sdk-rating/examples/form)
- [Disabled](https://hextaui.com/docs/ui-sdk-rating/examples/disabled)
- [Right to left](https://hextaui.com/docs/ui-sdk-rating/examples/rtl)
