Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples without using @headless-ui #23

Closed
Jighdan opened this issue Nov 18, 2022 · 2 comments
Closed

Examples without using @headless-ui #23

Jighdan opened this issue Nov 18, 2022 · 2 comments

Comments

@Jighdan
Copy link

Jighdan commented Nov 18, 2022

Looking at the Dialog component, any way of managing the transitions without bringing @headless-ui in? Getting two headless libraries seems dull

Great job on the repo :-)

@ecklf
Copy link
Owner

ecklf commented Dec 1, 2022

I don't think this is a zero-sum game, au contraire composing multiple headless libraries allows you to pull in their unique functionality without compromising on design. The Transition component was designed with Tailwind in mind, so it's working great for the use-case. Feel free to use your preferred solution 👍🏻.

@ecklf ecklf closed this as completed Dec 1, 2022
@rrmesquita
Copy link

I know this is a bit late, but you can use CSS animations. It works the same as Radix examples that use stitches. Here is an example:

// tailwind.config.js

animation: {
    'fade-in':  'fade-in 300ms ease-in-out',
    'fade-out': 'fade-out 300ms ease-in-out',
},
keyframes: {
    'fade-in': {
        from: { opacity: 0 },
        to:   { opacity: 1 },
    },
    'fade-out': {
        from: { opacity: 1 },
        to:   { opacity: 0 },
    },
},

Then in your components, you reference it with radix-state-open:animate-fade-in and radix-state-closed:animate-fade-out.

It's not perfect but it gets the job done without depending on a Transition component, or repeating boilerplate code with stitches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants