Giter VIP home page Giter VIP logo

tabler-icons-react's People

Contributors

dependabot[bot] avatar konradkalemba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tabler-icons-react's Issues

Get icon by string

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

Huge bundle size with dynamic import

Hello,

I'm currently using tabler-icons-react in a NextJS project.

I create a custom IconComponent that use tabler.
So i try to implement dynamic

import dynamic from 'next/dynamic';

// @ts-ignore
const DynamicIcons = dynamic(() =>
  import('tabler-icons-react').then((icons) => icons),
);

But the size of the bundle is huge.
Do you have any idea of to fix my issue?

Thanks in advance

Huge bundle size

image
I import it using code like

import { Archive, ShoppingCartDiscount, Trash } from 'tabler-icons-react';

but somehow the whole library is added to the bundle what am I doing wrong?

Add border as a parameter?

Today tabler-icons-react only support size, strokeWidth and color, I suggest adding padding and radius.

<ArrowUpRight size={30} strokeWidth={2} color="black" class="cursor-pointer border-2 border-solid" />
(this is in tailwind css)

I tried adding 2px padding with a solid border however, it seems to be overwritten by the css.
Wrapping a div and using the same skews the icon.

Any suggestion if we shouldn't padding and radius as parameters?

[update]
Found a solution using className instead of class fixes the issue.
<ArrowUpRight size={30} strokeWidth={2} color="black" className="cursor-pointer border-2 border-solid" />

Rename or prepend the names of the icon components.

As it stands, this library contains icons with the exact names used by many popular component libraries.
e.g. :- Container, Menu, Table, Tag, Space, Stack, Album, Align, Box.

It's suffice to say that it is quite annoying to develop when you're accidently importing the wrong component every time you auto import a heavily used component like Container from basically any UI library and you get an icon as the import rather than the actual component.

I would like to suggest to prepend the names of the icon components with a word like "Tabler" so it would say "TablerContainer" instead of Container. This will eliminate the issues with imports.

Provide a way to set a default color for all icons

We have business requirements that all icons should use some kind of purple color and you can imagine how tedious this gets when you need to specify it on each icon individually.

Is there a way to set a default color that all icons inherit? Ideally, it should still be overwritable.

Failed resolve

Hello I work on a project with mantine and React tsx and when i import the icon i receive and error
Failed to resolve import "@tabler/icons-react" from "src\components\Recover.tsx". Does the file exist?

How can i solve this problem?

Problem solved I was not using the lastest version of tabler.

Forward Ref Error because of Link component

(Using Next.js)

In the client console it warns the following:

Warning: Function components cannot be given refs. Attemps to access this ref will fail. Did you mean to use React.forwardRef()?

Check the render method of ForwardRef.

After some troubleshooting I've came to the conclusion that the Link from next/link is the cause of this error, is there a solution?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.