Ink Pill
Web (React)
A mono-set pill call-to-action washed in the theme's ink, with a diamond glyph and a paper-card sibling.
A pill call-to-action set in uppercase mono. The primary variant is an ink wash of the theme's primary colour that thins toward the paper, with a soft shadow and a small diamond glyph, and brightens on hover. The ghost variant is a card-coloured pill with a hairline border. Both follow the active theme and palette in light and dark mode. Hue, saturation and brightness grade the button with a CSS filter, and transitions are switched off when the user prefers reduced motion. The component centres the button in its parent and is transparent unless you pass background.
Installation
CLI
npx @modus-ui/cli add ink-pillManual
- Install
framer-motion. - Copy the code from the component tab.
- Create a file at
components/ui/ink-pill.tsx. - Paste the code.
Usage
tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "primary" | "ghost" | "primary" | Ink wash pill or card pill. |
label | string | "Begin a draft" | Button text. |
ring | boolean | true | Shows the small diamond glyph after the label. |
hue | number | 0 | Hue rotation in degrees, clamped to -180 to 180. |
saturation | number | 1 | Saturation multiplier, clamped to 0 to 2. |
brightness | number | 1 | Brightness multiplier, clamped to 0.35 to 1.65. |
disabled | boolean | false | Disables the button. |
type | "button" | "submit" | "reset" | "button" | Native button type. |
onClick | MouseEventHandler<HTMLButtonElement> | undefined | Click handler. |
background | string | undefined | Stage background; transparent when omitted. |
Comments