suiss/uim · Interaction

Tip

One-time hints shown as an inline card or a popover pointing at a control, remembered once dismissed.

Tip is an open-source mobile interaction from suiss/uim for React Native and Expo, with SwiftUI and Jetpack Compose versions built from the same design tokens. The @esuiss/uim CLI copies its source into your project, so you own the code.

iOS
Tip on iOS in light mode

Tip shows a hint until the user dismisses it, then records the dismissal under its id so it does not return. It renders either as a TipCard placed in the layout, or as a TipPopover with an arrow pointing at a TipAnchor. Touching the anchor also dismisses the tip.

TipGroup shows several tips one at a time in the order they mount, moving to the next when one is dismissed. Use tips to introduce a feature or gesture the user may not discover.

Installation

$ pnpm dlx @esuiss/uim@latest add tip

The CLI also adds what it builds on: Icon, Text.

Manual

  1. Install the dependencies:
npx expo install cn phosphor-react-native react-native-reanimated react-native-screens react-native-svg react-native-worklets
  1. Add the pieces it builds on: Icon, Text, and the primitives components/primitives/popover.tsx, components/primitives/types.tsx, components/primitives/use-render.tsx.

  2. Copy the source into components/interactions/tip.tsx:

uniwind/components/interactions/tip.tsx
import { cn } from "cn"
import { XIcon } from "phosphor-react-native"
import * as React from "react"
import {
  Platform,
  Pressable,
  useWindowDimensions,
  View,
  type ViewProps,
} from "react-native"
import {
  Easing,
  FadeInDown,
  FadeOut,
  Keyframe,
  ReduceMotion,
  1. Update the import paths to match your project.

Usage

import { TipGroup, Tip, TipCard, TipAnchor, TipPopover, TipIcon, TipContent, TipTitle, TipDescription, TipClose } from "@/components/interactions/tip"
<TipsExample fresh />

Give each Tip a stable id. Compose TipIcon, TipContent with TipTitle and TipDescription, and TipClose inside a TipCard or TipPopover. For a popover, wrap the target in TipAnchor inside the same Tip.

By default dismissals are kept in memory and reset when the app restarts. To persist them, pass a storage adapter to TipGroup with getItem and setItem, sync or async, such as one backed by your app's key-value store. Keys are prefixed with tip:. resetTips(ids, storage) clears dismissals, and useTip returns visible and dismiss. The TipStorage type is exported.

Examples

Card

An inline card tip with an icon, title, description and close button.

iOS
Tip (card) on iOS in light mode

API Reference

TipGroup

Shows its tips one at a time and supplies the storage.

PropType
About
Adapter with getItem and setItem for remembering dismissals. Defaults to in-memory storage.
Type
TipStorage
Default
memoryStorage
Type
React.ReactNode
Default
—

Tip

One hint, identified by id.

PropType
About
Stable key used to remember the dismissal.
Type
string
Default
required
About
Milliseconds to wait before showing. Defaults to 0.
Type
number
Default
0
About
Called when the tip is dismissed.
Type
() => void
Default
—
Type
React.ReactNode
Default
—

TipCard

Renders the tip inline as a card.

ExtendsViewProps

TipAnchor

The element the popover points at.

ExtendsViewProps

TipPopover

Renders the tip as a popover next to the anchor.

ExtendsReact.ComponentProps<typeof PopoverPrimitive.Popup>
PropType
About
Side of the anchor to show on. Defaults to bottom.
Type
Side
Default
"bottom"
About
Alignment against the anchor. Defaults to center.
Type
Align
Default
"center"
About
Gap from the anchor. Defaults to 10.
Type
number
Default
10
About
Name of a portal host to render into.
Type
string
Default
—

TipIcon

A decorative icon slot.

ExtendsViewProps

TipContent

Holds the title and description.

ExtendsViewProps

TipTitle

The tip's heading.

ExtendsReact.ComponentProps<typeof Text>

TipDescription

The tip's supporting text.

ExtendsReact.ComponentProps<typeof Text>

TipClose

A button that dismisses the tip.

ExtendsReact.ComponentProps<typeof Pressable>

Accessibility

  • TipCard has the note role.
  • TipPopover is non-modal, does not move focus, and is labelled by TipTitle.
  • TipClose is labelled Dismiss tip.
  • The icon is hidden from screen readers.

Notes

  • Cards use bg-surface-secondary; popovers use bg-surface-raised with a border that is stronger in dark mode, and are up to 320 points wide.
  • Animations respect the system reduce motion setting.
  • On iOS the popover renders in a full-window overlay so it appears above native screens.