tabler-icons-react icon indicating copy to clipboard operation
tabler-icons-react copied to clipboard

Get icon by string

Open PixelPage-YT opened this issue 2 years ago • 0 comments

Hello, In my database, I need to store the icons as a string like "shoe" or "x". But if I want them in my DOM, I need to build something like this:

import { Shoe, X } from "tabler-icons-react";
const data = {
    shoe: Shoe,
    x: X,
}

const selectedIcon = data["shoe"];

Is there an easier way? Greetings, PixelPage

PixelPage-YT avatar Sep 20 '22 19:09 PixelPage-YT