On this page
@addTagHelper *, Webority.Ui.RazorBasic tooltip
Wrap any control with a short hint, shown on hover or keyboard focus.
Placement
Choose the side the tip opens on; it flips to stay in view if the edge is near.
Content
The content is plain text. React's <AppTooltip> accepts any rich ReactNode for its content prop: bold text, multiple lines, inline elements. Razor's <app-tooltip> renders once on the server, so content is a plain string only.
Shortcut
Show the key that runs an action in its tip, for an action people repeat many times a day.
On icon buttons
Use a tip on an icon-only control, where the icon alone may not say what it does.
Tones and sizes
Pick a preset tone or size for a tip; the defaults suit most controls.
Every option
Every value of every prop, one cell each.
content: short, long and rich
content="Short tip"content="A longer explanatory tooltip that wraps onto more than one line"content={<><strong>Bold</strong> + text</>} (React only)children: the trigger element
trigger: app-buttontrigger: app-action-icontrigger: plain inputtrigger: aria-disabled button, still focusableplacement: all five
placement="auto"placement="top" (default)placement="bottom"placement="start"placement="end"tone: all five
tone="neutral" (default)tone="primary"tone="success"tone="warning"tone="danger"variant: inverse
variant="inverse"size: all three
size="sm"size="md" (default)size="lg"shortcut: the key chip
shortcut="a"open: shows the tip
open="false" (default)open="true"className: extra class
class="sc-tip-brand" (sets the --wui-tooltip-* vars)Guidance
What to do, and what to avoid.
Use it when
- Quick, context-sensitive hints on icon buttons, abbreviations, shortcuts.
- Brief content: a sentence or two, never a help article.
- Alongside clear labels or icons, not instead of them.
Reach for something else when
- Essential information: not everyone hovers, so put it in visible copy.
- Help text that exists only in the tooltip; repeat it in the form or docs.
- Tooltips on every element: clutter trains people to ignore them.
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
9 props. The 5 most used come first.
Used on most screens 5 props
| Prop | Type | Default | Description |
|---|---|---|---|
| contentdefault - | string | - | The tooltip text (required). Same as React content. |
| placementdefault top | auto | top | bottom | start | end | top | Where the tooltip appears. A named side is preferred but flips if needed to stay in view; auto lets Popper pick the side with the most room outright. Either way the tooltip never clips off-screen. |
| tonedefault neutral | neutral | primary | success | warning | danger | neutral | Preset colour of the tooltip. neutral is the light surface look; the others are solid tints. For a fully custom colour, pass a class whose rule sets the --wui-tooltip-bg, --wui-tooltip-color, --wui-tooltip-border and --wui-tooltip-radius CSS vars. |
| variantdefault - | inverse | - | inverse draws the tooltip on a dark surface, for a tip inside a light page. |
| sizedefault md | sm | md | lg | md | Preset size (font size, padding and max width). For a fully custom size, pass a class that sets the --wui-tooltip-font-size, --wui-tooltip-padding-y, --wui-tooltip-padding-x and --wui-tooltip-max-width CSS vars. |
Less common 4 props
| Prop | Type | Default | Description |
|---|---|---|---|
| shortcutdefault - | string | - | The key that runs the action ("A", "E", "/"), drawn as a key chip after the text ("Approve A"). One character is written in upper case. |
| opendefault false | bool | false | Shows the panel open, for a design preview or a controlled caller. |
| classdefault - | string | - | Forwarded onto the tooltip; use it to set custom --wui-tooltip-* CSS vars. |
| (content)default - | - | - | Child content: the trigger element (any markup). |
Screen reader
3 notes- The tooltip opens on hover and on keyboard focus of the trigger, so keyboard users get the same hint.
- The tooltip carries a generated id, and the trigger points at it with aria-describedby while it is open.
- Placement flips to stay inside the viewport, but essential information still belongs in visible copy.