Icon
Icon is a general icon component that can be used in your projects.
<GhostIcon />
Usage
import { GhostIcon } from "@yamada-ui/react"
import { GhostIcon } from "@/components/ui"
import { GhostIcon } from "@workspaces/ui"
<GhostIcon />
You can find all the icons we offer at here.
Using React Icons
When using React Icons, set the component to as.
import { Icon } from "@yamada-ui/react"
import { FaRobot } from "react-icons/fa"
<Icon as={FaRobot} />
Using Lucide lab
When using Lucide lab, use LucideIcon.
import { LucideIcon } from "@yamada-ui/react"
<LucideIcon iconNode={burger} />
Props
Accessibility
If you set aria-hidden={false} and aria-label on Icon or LucideIcon, it will be read by screen readers.
<Icon as={FaRobot} aria-hidden={false} aria-label="Robot" />
ARIA Roles and Attributes
| Component | Roles and Attributes | Usage |
|---|---|---|
Icon, LucideIcon | role="img" | Indicates that this is an image. |
aria-hidden | Excludes the element from the accessibility tree. |