5.0.0 • Published 6 months ago

@leafygreen-ui/info-sprinkle v5.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
6 months ago

Info Sprinkle

npm (scoped)

View on MongoDB.design

Installation

Yarn

yarn add @leafygreen-ui/info-sprinkle

NPM

npm install @leafygreen-ui/info-sprinkle

Example

import { InfoSprinkle } from `@leafygreen-ui/info-sprinkle`;

<InfoSprinkle
  triggerProps={{
    onMouseDown: () => {},
    onMouseOver: () => {},
    'aria-label': 'aria-label',
  }}>
  I'm an info sprinkle
</InfoSprinkle>

Properties

Properties

PropTypeDescriptionDefault
openbooleanControls the component, and determines whether or not the <Tooltip /> will appear open or closed.false
setOpenfunctionIf controlling the component, pass state handling function to setOpen prop. This will keep the consuming application's state in-sync with LeafyGreen's state, while the <Tooltip /> component responds to events such as backdrop clicks and a user pressing the Escape key.(boolean) => boolean
initialOpenbooleanPasses an initial "open" value to an uncontrolled Tooltip.false
shouldClosefunctionCallback that should return a boolean that determines whether or not the <Tooltip /> should close when a user tries to close it.() => true
align'top', 'bottom', 'left', 'right'Determines the preferred alignment of the <Tooltip /> component relative to the element passed to the trigger prop. If no trigger is passed, the Tooltip will be positioned against its nearest parent element.'top'
justify'start', 'middle', 'end'Determines the preferred justification of the <Tooltip /> component (based on the alignment) relative to the element passed to the trigger prop. If no trigger is passed, the Tooltip will be positioned against its nearest parent element.'start'
darkModebooleanDetermines if the <Tooltip /> will appear in dark mode.false
idstringid applied to <Tooltip /> component
classNamestringApplies a className to Tooltip container
childrennodeContent that will be rendered inside of <Tooltip />
enabledbooleanEnables Tooltip to trigger based on the event specified by triggerEvent.true
onClosefunctionCallback that is called when the tooltip is closed internally. E.g. on ESC press, on backdrop click, on blur..() => {}
baseFontSize13 | 16font-size applied to typography elementdefault to value set by LeafyGreen Provider
triggerPropsOmit<ComponentProps<'button'>, 'ref'>Trigger props, excludes ref
...native div attributesAny other props will be spread on the root div element

Note: The ref of this component will be the trigger icon but all props will spread to the internal <Tooltip/> component.

5.0.0

6 months ago

4.0.9

8 months ago

4.0.8

9 months ago

3.0.0

12 months ago

4.0.5

10 months ago

4.0.4

10 months ago

4.0.10

8 months ago

4.0.7

9 months ago

4.0.6

9 months ago

4.0.1

11 months ago

4.0.0

11 months ago

4.0.3

10 months ago

4.0.2

11 months ago

4.0.12

8 months ago

4.0.11

8 months ago

4.0.14

7 months ago

4.0.13

7 months ago

2.1.0

1 year ago

2.0.0

1 year ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.3-popover.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago