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 Component: Tooltip #342

Closed
haworku opened this issue Jul 21, 2020 · 0 comments
Closed

New Component: Tooltip #342

haworku opened this issue Jul 21, 2020 · 0 comments
Assignees
Labels
type: feature New feature or request
Milestone

Comments

@haworku
Copy link
Contributor

haworku commented Jul 21, 2020

Tooltip

A tooltip is a short descriptive message that appears when a user hovers or focuses on an element.

Description

Any element with the class name usa-tooltip and a title attribute will become a tooltip.

Requirements (proposed)

Prop Interface

TooltipProps = {
  label: string
  position: 'top' | 'bottom' | 'left' | 'right'
} 

More Details

  • position prop used as data-position on tooltip element
  • label is used as title on tooltip element
  • Our tooltip component then takes any element (perhaps as children or as a prop or as hook, developer choice) and adds these attributes.
  • The tooltip popover is generated with javascript - see uswds tooltip js. We may want to reach for an existing tooltip library or utility rather than entirely re-implementing.
  • Tooltips are progressive enhancements for the title attribute, and will display as the title attribute if the component doesn’t initialize.
@haworku haworku added the type: feature New feature or request label Jul 21, 2020
@haworku haworku added this to the USWDS 2.8.0 milestone Jul 21, 2020
@noelledusahel noelledusahel self-assigned this Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants