Giter Site home page Giter Site logo

chrisuser / react-usage-bar Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 2.0 4.32 MB

React component to display the usage of space or the sectors for which a container is divided.

Home Page: https://chrisuser.github.io/react-usage-bar/

License: MIT License

TypeScript 73.80% JavaScript 6.54% CSS 17.93% HTML 1.73%
react usage-data design bar usage typescript storybook component react-component disk-usage

react-usage-bar's Introduction

Hi there ๐Ÿ‘‹

I'm Cristiano, a Frontend developer based in Italy. Firm supporter of open source ๐Ÿ’ป, art ๐ŸŽจ, music ๐ŸŽน and cinema ๐ŸŽฌ passionate. Always pushing myself towards my limits with the intent to overcome them ๐Ÿ’ช. Learning something new every day ๐ŸŒฑ.

Co-Founder of Massbit, currently working @ 22HBG.

Past years activity


2022

2022 GitHub ChrisUser's activity graph

2021

2021 GitHub ChrisUser's activity graph

2020

2020 GitHub ChrisUser's activity graph

react-usage-bar's People

Contributors

chrisuser avatar dependabot[bot] avatar vgribdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-usage-bar's Issues

[Bug]: Remove padding from UsageBar

What happened?

Is it possible to remove the padding from the UsageBar? My personal opinion is that child components shouldn't enforce on the parent how the child is allowed to lay out on the page.
image

image

Version

1.1.22

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[v1.1.8] Color fallback property is not always correctly defined

Affected versions

v1.1.7 - v1.1.8

Bug description

Most of the times one or more slots, without a previous defined background color, render as a transparent block.

Possible solution

  • This bug could be caused by the concurrence of the two useEffect hooks: one sets the array of the colors used (later) for the items without one; the other formats the items array with the correct color property.

The effect is that the items are, sometimes, formatted before the full usedColors array is populated.

  • Also the callback that renders the usageBar isn't triggered by the formatted items array changes, it runs only once.

[New Feature]: Support classes for colors

Describe your proposal

In my project I use tailwind which supports theme-based color classes like this

<div class="bg-red-500 dark:bg-red-100">

This applies a medium red background color when in light mode, and a light red color when in dark mode. I would love the ability to do set the item colors using these classes.

<UsageBar
  items={[
    { name: "macOS", value: 1, class: "bg-blue-500 dark:bg-blue:100" },
    { name: "Debian", value: 1, class: "bg-red-500 dark:bg-red:100" },
  ]}/>

Technical details

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

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.