PolyHunter

MissionBookmark

Bookmark toggle for missions. Default shows a plus, saved shows a check in the success color, and error shows a plus in the danger color.

Playground

Live preview

Examples

Variants and sizes

Card header: 24px artwork in a 24px control

Signed-out visitor — disabled bookmark

Code

import { MissionBookmark } from "@npolyhunter/ui";

// variant: "default" (plus, neutral) | "saved" (check, success) | "error" (plus, danger)
// Clicking flips between default and saved like a toggle.
<MissionBookmark
  variant={saved ? "saved" : "default"}
  onClick={() => setSaved((v) => !v)}
/>

// Error state — bookmark action failed
<MissionBookmark variant="error" aria-label="Bookmark failed, retry" />;

// Size follows IconButton: "compact" | "small" | "medium" (default)
<MissionBookmark size="small" />;

// Card header: 24px button and 24px artwork
<MissionBookmark size="small" iconSize="large" />;

// Signed-out visitor: native disabled button, including keyboard activation
<MissionBookmark disabled aria-label="Sign in to save this item" />;

Code

import { MissionBookmark } from "@npolyhunter/ui";

// variant: "default" (plus, neutral) | "saved" (check, success) | "error" (plus, danger)
// Clicking flips between default and saved like a toggle.
<MissionBookmark
  variant={saved ? "saved" : "default"}
  onClick={() => setSaved((v) => !v)}
/>

// Error state — bookmark action failed
<MissionBookmark variant="error" aria-label="Bookmark failed, retry" />;

// Size follows IconButton: "compact" | "small" | "medium" (default)
<MissionBookmark size="small" />;

// Card header: 24px button and 24px artwork
<MissionBookmark size="small" iconSize="large" />;

// Signed-out visitor: native disabled button, including keyboard activation
<MissionBookmark disabled aria-label="Sign in to save this item" />;

Used in

Includes use through shared UI components.

App