GithubHelp home page GithubHelp logo

Comments (8)

Johann01 avatar Johann01 commented on August 21, 2024 3

A small trick that I use as a workaround maybe someone need is.

I do a wrapper div and then add the CSS with a selector:

 const CLASSES = clsx(
    "[&>div>table>tbody>tr>td]:!pb-2",
    "[&>div>table>tbody>tr>td]:!pt-2",
    "[&>div>table]:!h-96",
    "[&>div.tremor-base.tr-absolute]:!bg-white",
    "[&]:overflow-scroll h-96"
  );
  
  return (
    <>
      <div className={CLASSES}>
        <Table>
          <TableHead>
            <TableRow>
              <TableHeaderCell>Name</TableHeaderCell>
              <TableHeaderCell textAlignment="text-left">Leads</TableHeaderCell>
              <TableHeaderCell textAlignment="text-left">
                Sales ($)
              </TableHeaderCell>
              <TableHeaderCell textAlignment="text-left">
                Quota ($)
              </TableHeaderCell>
              <TableHeaderCell textAlignment="text-left">
                Variance
              </TableHeaderCell>
              <TableHeaderCell textAlignment="text-left">
                Region
              </TableHeaderCell>
              <TableHeaderCell textAlignment="text-left">
                Status
              </TableHeaderCell>
            </TableRow>
          </TableHead>
          <TableBody>
            {transactions.pages.map((item) => (
              <>
                {item.transactions.map((item) => (
                  <TableRow key={item.nameReferenzkonto}>
                    <TableCell>{item.nameReferenzkonto}</TableCell>
                    <TableCell textAlignment="text-left">
                      {item.verwendungszweck}
                    </TableCell>
                    <TableCell textAlignment="text-left">
                      {item.betrag}
                    </TableCell>
                    <TableCell textAlignment="text-left">
                      {item.waehrung}
                    </TableCell>
                    <TableCell textAlignment="text-left">
                      {item.buchungstag.toLocaleDateString()}
                    </TableCell>
                    <TableCell textAlignment="text-left">
                      {item.beguenstigterOrAuftraggeber}
                    </TableCell>
                  </TableRow>
                ))}
              </>
            ))}
          </TableBody>
        </Table>
        <Footer height="h-10">
          <div className="w-full" />
          <ButtonInline
            size="sm"
            text="Load more"
            icon={ArrowRightIcon}
            iconPosition="right"
            handleClick={() =>
              fetchNextPage({
                pageParam:
                  transactions.pages[transactions.pages.length - 1]?.cursor,
              })
            }
          />
        </Footer>
      </div>
    </>
  );

from tremor.

steventsao avatar steventsao commented on August 21, 2024 3

because most of the components are nested, thus we would need to think about an appropriate design to implement this. We are currently discussing what level of customisation we would like to give to the user, as we want to find a balance between easy-to-use/good looking components vs customisation tailored to everyone's use case. Therefore we are gathering feedback from our users to determine which path to follow. So we are always happy for any sort of input on the library! 😊

Hi, is there a post on where tremor is going with the balance between "good looking" presets vs. customization with className? I imagine exposing className satisfies the customization needs, but what about the original intent of limiting customization for a good preset? I imagine that with className, there is no balancing anymore because the customization is infinite. That being said, infinite customization is not mutually exclusive with offering presets either.

Just curious from the standpoint of designing a library, thank you! @mitrotasios

from tremor.

github-actions avatar github-actions commented on August 21, 2024 1

🎉 This issue has been resolved in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

from tremor.

mitrotasios avatar mitrotasios commented on August 21, 2024

hi @wburningham, thanks a lot for the feedback! Unfortunately something like this is not possible at the moment, because we have defined interfaces with specific props for each component. Implementing a new prop such as className is rather tricky (for now) because most of the components are nested, thus we would need to think about an appropriate design to implement this. We are currently discussing what level of customisation we would like to give to the user, as we want to find a balance between easy-to-use/good looking components vs customisation tailored to everyone's use case. Therefore we are gathering feedback from our users to determine which path to follow. So we are always happy for any sort of input on the library! 😊

from tremor.

joakimbeng avatar joakimbeng commented on August 21, 2024

To get the scrolling working with the sticky headers I did:

<div className="[&_>_div]:max-h-[42rem] [&_th]:bg-white">
  <Table>
    <TableHead>
		...

Thanks for the tip @Johann01!

from tremor.

john-tipper avatar john-tipper commented on August 21, 2024

Thanks for the tip @Johann01, I think this may be a way of injecting dark mode classes for #208.

from tremor.

severinlandolt avatar severinlandolt commented on August 21, 2024

Relates to #135

from tremor.

joekendal avatar joekendal commented on August 21, 2024

At least need to edit the Card rounded and shadow classes

from tremor.

Related Issues (20)

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.