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

[✨](headless): add side data-attributes to popover #777

Open
maiieul opened this issue May 26, 2024 · 0 comments
Open

[✨](headless): add side data-attributes to popover #777

maiieul opened this issue May 26, 2024 · 0 comments
Assignees
Labels
COMMUNITY: PR is welcomed We think it's a good feature to have but would love for the community to help with the PR for it TYPE: enhancement New feature or request

Comments

@maiieul
Copy link
Contributor

maiieul commented May 26, 2024

So that we could add animations when it's floating depending on where it is relative to the trigger.

For example (look at the classes far at the right):

const Panel = component$<PropsOf<typeof HeadlessPopover.Panel>>(({ ...props }) => {
  return (
    <HeadlessPopover.Panel
      {...props}
      class={cn(
        'w-72 rounded-md border bg-popover p-4 text-popover-foreground opacity-0 shadow-md outline-none  data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95 data-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
        props.class,
      )}
    >
      <Slot />
    </HeadlessPopover.Panel>
  );
});
@maiieul maiieul assigned maiieul and unassigned maiieul May 31, 2024
@shairez shairez added the TYPE: enhancement New feature or request label May 31, 2024
@maiieul maiieul changed the title feat(headless): add side data-attributes to popover [✨](headless): add side data-attributes to popover Jun 1, 2024
@maiieul maiieul self-assigned this Jul 18, 2024
@maiieul maiieul added the COMMUNITY: PR is welcomed We think it's a good feature to have but would love for the community to help with the PR for it label Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMMUNITY: PR is welcomed We think it's a good feature to have but would love for the community to help with the PR for it TYPE: enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

2 participants