# Tooltip: Keyboard shortcut

> Put a `Kbd` or `KbdGroup` after the label. It picks up the tooltip’s colors and sits at the end, showing ⌘ on Apple devices and Ctrl elsewhere.

Example: https://hextaui.com/docs/tooltip/examples/shortcut
Component docs: https://hextaui.com/docs/tooltip.md

## Add this example

```bash
npx shadcn@latest add https://hextaui.com/r/tooltip-shortcut.json
```

This adds `components/examples/tooltip/shortcut.tsx` with the Tooltip component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/tooltip/shortcut.tsx"
import { IconDeviceFloppy } from "@tabler/icons-react"

import { Button } from "@/components/ui/button"
import { KbdGroup } from "@/components/ui/kbd"
import {
  Tooltip,
  TooltipContent,
  TooltipTrigger,
} from "@/components/ui/tooltip"

export function TooltipShortcut() {
  return (
    <div className="flex flex-wrap items-center justify-center gap-2">
      <Tooltip>
        <TooltipTrigger render={<Button variant="outline" />}>
          <IconDeviceFloppy data-icon="inline-start" />
          Save
        </TooltipTrigger>
        <TooltipContent>
          Save changes
          <KbdGroup keys="mod+s" size="sm" />
        </TooltipContent>
      </Tooltip>
      <Tooltip>
        <TooltipTrigger render={<Button variant="outline" />}>
          Go to inbox
        </TooltipTrigger>
        <TooltipContent>
          Go to inbox
          <KbdGroup keys="g i" size="sm" />
        </TooltipContent>
      </Tooltip>
    </div>
  )
}
```

## Props in this example

### TooltipTrigger

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `render` | `ReactElement \| (props, state) => ReactElement` | `<button>` |  |

## More Tooltip examples

- [Sides](https://hextaui.com/docs/tooltip/examples/sides.md)
- [With an arrow](https://hextaui.com/docs/tooltip/examples/arrow.md)
- [Toolbar](https://hextaui.com/docs/tooltip/examples/toolbar.md)
- [Disabled](https://hextaui.com/docs/tooltip/examples/disabled.md)
- [Long content](https://hextaui.com/docs/tooltip/examples/long-content.md)
- [Controlled](https://hextaui.com/docs/tooltip/examples/controlled.md)
- [One tooltip, many triggers](https://hextaui.com/docs/tooltip/examples/detached.md)
- [Right to left](https://hextaui.com/docs/tooltip/examples/rtl.md)
