Coder Social home page Coder Social logo

Comments (5)

robinvdvleuten avatar robinvdvleuten commented on May 28, 2024 1

I figured it out using the following

{
  extend: {
    keyframes: {
      radixCarouselSlideDown: {
        from: { height: 0 },
        to: { height: 'var(--radix-accordion-content-height)' },
      },
      radixCarouselSlideUp: {
        from: { height: 'var(--radix-accordion-content-height)' },
        to: { height: 0 },
      }
    }
  }
}

And then use a custom animation class to trigger the animations

<Accordion.AccordionContent asChild>
  <div className="overflow-hidden radix-state-open:animate-[radixCarouselSlideDown_300ms_ease-in-out] radix-state-closed:animate-[radixCarouselSlideUp_300ms_ease-in-out]">
    {children}
  </div>
</Accordion.AccordionContent>

from tailwindcss-radix.

ecklf avatar ecklf commented on May 28, 2024

Do you have a reproduction at hand? The examples are in the demo folder in this repo.
https://github.com/ecklf/tailwindcss-radix/blob/main/demo/components/accordion.tsx

from tailwindcss-radix.

cubecleveland avatar cubecleveland commented on May 28, 2024

Wow thanks for the super quick reply.

If trying to achieve a simple slide up and down to the accordion. i went through the demo.... unless im really missing smething it doesnt have animation for slide up and down of content... am i correct ? i want the content itslef to slide up and down rather than just the Chevron...

from tailwindcss-radix.

ecklf avatar ecklf commented on May 28, 2024

You'd want something like in the official radix example then: https://www.radix-ui.com/docs/primitives/components/accordion

CleanShot 2022-11-03 at 11 32 08

from tailwindcss-radix.

cubecleveland avatar cubecleveland commented on May 28, 2024

Yes, but could u help and tell me how do i actually apply this in the tailwind varinats -- i put this in my animation extend in tailwind config....

from tailwindcss-radix.

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.