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

New Drawer / Sidebar #285

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

New Drawer / Sidebar #285

wants to merge 4 commits into from

Conversation

kylerberry
Copy link
Collaborator

@kylerberry kylerberry commented Jun 30, 2023

What this PR does

Experimenting with a new sidebar and drawer components using some more modern and composable patterns

Testing

https://vimeo.github.io/iris/sb/sidebar-hotness/?path=/story/components-drawer

@kylerberry kylerberry changed the title initial commit on a new drawer component New Drawer / Sidebar Jun 30, 2023
children,
}: DrawerProps) => {
return (
<AnimatePresence>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can give this an exitBeforeEnter prop so the exit animation can happen before framer removes the element from the dom.

// finalFocusRef,
// returnFocusOnClose,
// preserveScrollBarGap,
children,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add a spread prop and pass it to motion.div to expose motion props to the parent.

const DrawerComponent = ({
  ...,
  children,
  ...motionProps
}: DrawerProps & MotionProps) => {
  return (
    <motion.div {...motionProps}>
  )
}

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

Successfully merging this pull request may close these issues.

2 participants