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

ModalHeader should have option to position contents in <header> tag #74

Open
Glidias opened this issue Mar 18, 2022 · 0 comments
Open

Comments

@Glidias
Copy link

Glidias commented Mar 18, 2022

For ModalHeader component, it would be good to have an option to place the contents within the <header> tag of the Modal, currently, it places contents below it which may not be ideal when it comes to space effeicency. For placing within header, apply justify-between to it so that the header text will be on left and close button on right hand side.

export interface ModalProps extends React.HTMLAttributes<HTMLDivElement> {
  /**
   * Function executed when the dropdown is closed
   */
  onClose: () => void
  /**
   * Defines if the modal is open
   */
  isOpen: boolean
  /**
  * Defines custom child contents to place into header tag of Modal
  */
  header?: React.ReactChild
}
  <header className="flex justify-between">
      <div>{props.header}</div>
      <button
        className="inline-flex items-center justify-center w-6 h-6 text-gray-400 transition-colors duration-150 rounded dark:hover:text-gray-200 hover: hover:text-gray-700"
        aria-label="close"
        onClick={onClose}
      >
@Glidias Glidias changed the title ModalHeader should have option to position text in <header> tag ModalHeader should have option to position contents in <header> tag Mar 18, 2022
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

1 participant