Modus UI

Flick Notice

Web (React)

A card-stock notice that slides in, burns down a thin primary fuse and flicks away under a swipe.

The surface follows the theme's card and border tokens with a serif title, so it reads as a slip of paper rather than a system pill. Drag it past the swipe distance to dismiss, or hover to pause the fuse.

Draft filed to the folio

Swipe it away, or let the fuse run out.

Modus / Flick Notice

Installation

CLI

npx @modus-ui/cli add flick-notice

Manual

  1. Copy the code from the component tab.
  2. Create a file at components/ui/flick-notice.tsx.
  3. Paste the code.

Usage

tsx
import { FlickNotice } from "@/components/ui/flick-notice";

export default function Example() {
  return <FlickNotice title="Draft filed to the folio" />;
}

Props

PropTypeDefaultDescription
titlestring"Draft filed to the folio"Serif headline.
descriptionstring""Supporting line.
iconany-Optional leading icon.
actionLabelstring""Label of the action button; empty hides it.
onActionany-Called when the action is pressed.
openbooleantrueWhether the notice is shown.
onCloseany-Called when the notice leaves.
backgroundstring"hsl(var(--card))"Card colour.
colorstring"hsl(var(--foreground))"Text colour.
fuseColorstring"hsl(var(--primary))"Fuse colour.
widthnumber356Width in pixels.
radiusnumber12Corner radius in pixels.
slideMsnumber400Entrance duration in milliseconds.
settleBouncenumber0.2Entrance spring bounce.
swipeDistancenumber40Drag distance that dismisses, in pixels.
durationnumber4000Time before it leaves, in milliseconds; 0 stays.
fusestring"bottom"Fuse edge: "top", "bottom" or "none".
pauseOnHoverbooleantruePauses the fuse while hovered.
closeButtonbooleanfalseShows a close button.
inlinebooleanfalseRenders in flow instead of fixed to the corner.
dismissiblebooleantrueAllows swiping away.

Comments

  • No comments yet.