Feedback/DSTidbit

DSTidbit

feedback
since 1.2.0

Inline callout card with icon, title, body text, optional button, and dismiss.

iOSmacOS

Purpose

Use for contextual tips, hints, or inline notifications within content. Less intrusive than modals.

Interactive Reference

Live showroom

Need the full visual surface?

Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().

Best for exploring:

variants, states, categories, and real app examples in one place.

Variants

tidbit-info screenshot

.info

Blue with info icon

tidbit-success screenshot

.success

Green with checkmark icon

tidbit-warning screenshot

.warning

Yellow with warning icon

tidbit-error screenshot

.error

Red with error icon

Props

PropTypeDefaultDescription
titleString?nilOptional title
bodyreqStringโ€”Main text content
styleDSTidbitStyle.infoStyle: .info, .success, .warning, or .error
buttonTitleString?nilOptional button label
buttonAction(() -> Void)?nilOptional button action
onDismiss(() -> Void)?nilIf set, shows close button
accessibilityLabelString?nilOptional accessibility label

Examples

Helpful tip

Inline tip with action button.

swift
DSTidbit(
    title: "Pro tip",
    body: "Use keyboard shortcuts to work faster.",
    style: .info,
    buttonTitle: "Learn more",
    buttonAction: { showShortcuts() },
    onDismiss: { dismissTip() }
)

Warning message

Warning without title or actions.

swift
DSTidbit(
    body: "Changes will be lost if you navigate away.",
    style: .warning
)

Usage Guidelines

  • Use for contextual, non-blocking messages
  • Place near related content for context
  • Keep body text concise (1-2 sentences)
  • Use dismiss button for optional tips, not critical warnings

Related Components