Current section

Files

Jump to
noora docs components tooltip.md
Raw

docs/components/tooltip.md

<!-- Generated by scripts/generate-web-components.js. Do not edit directly. -->
# Tooltip
Explains an element on pointer hover or keyboard focus.
```html
<noora-tooltip title="Copy"><button slot="trigger">Copy</button></noora-tooltip>
```
## Attributes
| Attribute | Type or allowed values | Default | Description |
| --- | --- | --- | --- |
| `disabled` | `boolean` | `false` | Disables the tooltip. |
| `size` | `small`, `large` | `"small"` | Controls the content layout. |
| `title` | `string` | `""` | Sets the tooltip title. |
| `description` | `string` | None | Sets the large-tooltip description. |
| `open` | `boolean` | `false` | Controls whether the tooltip is open. |
## Events
| Event | Type | Description |
| --- | --- | --- |
| `noora-open-change` | `CustomEvent<{ open: boolean }>` | Emitted when the tooltip opens or closes. |
## Slots
| Slot | Description |
| --- | --- |
| `trigger` | The described element. |
| `icon` | An icon shown by large tooltips. |
## Styling parts
| Part | Description |
| --- | --- |
| `trigger` | The trigger wrapper. |
| `content` | The tooltip content. |
## Default
Explain an icon or compact action.
```html
<noora-tooltip title="Tooltip"><noora-icon slot="trigger" name="alert_circle" label="More information"></noora-icon></noora-tooltip>
```
## Large
Add an icon and supporting description.
```html
<noora-tooltip size="large" title="Tooltip" description="Insert tooltip description here. Three lines of text would look better."><noora-icon slot="trigger" name="alert_circle" label="More information"></noora-icon><noora-icon slot="icon" name="category"></noora-icon></noora-tooltip>
```