Monthly or yearly toggle

A two button pill in a plan card that swaps every price between monthly and yearly and carries the saving in its label.

ControlsFreeFrom Tally, ProductAbout 2k tokens saved
The whole page

Links in the preview stay on the block.

Open on its own

The prompt

One prompt, written to stand on its own: goal, structure, type, colour, spacing, behaviour and the words in square brackets to replace. Paste it into any tool that writes HTML. The Code tab has this block as one file.

671 words
Download .zip
# Monthly or yearly toggle

One controls component, not a whole page: build it to drop into a page that already exists. Works in Claude, v0, Lovable, Bolt, Cursor or any tool that writes HTML.

## Goal
A two button pill in a plan card that switches the prices between monthly and yearly billing, the saving stated on the button. For a subscription pricing section.

## Structure
1. Plan card, 1px border, 32px radius.
2. Card header row, spread to both edges, wrapping, holding the control.
3. The control: a div, role group, aria-label, 4px padding, pill radius.
4. Two buttons with aria-pressed, the second holding a small element with the saving.
5. The price block it writes: a large figure and a two line note at its baseline.

## Type
Buttons Satoshi 500, 15px/1, the saving 12px. Large figure Chillax 600 clamp(96px,10vw,160px)/.8, letter spacing minus .05em, holding at 96px under 640px; its note 17px/1.35. Body Satoshi 400, 18px/1.5, 17px under 640px. Both free on Fontshare.

## Colour
Card #FFFFFF with a 1px #E3E3DE border. Control #F3F3F1; labels #5F5F5A at rest, #121212 on hover, #FFFFFF on #121212 when pressed. Price note #5F5F5A. Focus ring #121212. AA: #5F5F5A on #F3F3F1 and on #FFFFFF, #FFFFFF on #121212.

## Spacing and lines
Control padding 4px, radius 999px; buttons 40px tall, 44px minimum width, padding 0 16px, the saving 6px after the label. Card padding clamp(24px,2.6vw,36px), header gap 16px. The price block sits clamp(26px,3vw,40px) under the header, clamp(22px,2.4vw,30px) above what follows, 14px between figure and note. Card grid 12 columns, gap clamp(14px,1.8vw,24px), container 1440px.

## Behaviour
Script needed. Clicking a button sets aria-pressed true on it and false on the other, then writes the figure, the note and every other plan price on the page from one table of monthly and yearly values, so no readout is left behind. Background and colour move over .35s cubic-bezier(.16,1,.3,1), and hovering the unpressed label darkens it on the same timing. Nothing happens on load or on scroll into view.

## Responsive
At 979px the pricing grid becomes a single block, the card taking a 40px top margin. At 640px the page drops to 17px and the figure holds at 96px.

## Accessibility
Role group, not a radiogroup, so both buttons stay reachable with Tab. The saving sits inside the second button, so it is read as part of that label. If the price must be announced, give the price block aria-live polite. Focus ring 2px solid #121212, offset 3px. Buttons are 40px tall inside 4px of padding, a 48px target.

## Built values (from code.html)
- Fonts: DM Mono 400, 500 (Google Fonts); Chillax 500, 600, 700 (Fontshare); Satoshi 400, 500, 700 (Fontshare).
- Colour variables: --sun #FFC93C, --sun-2 #FFD766, --sun-t #FFF1C4, --ink #121212, --ink-2 #1B1B1B, --ink-3 #2B2B2B, --white #FFFFFF, --soft #F3F3F1, --muted #5F5F5A, --muted-d #A3A39C, --on-sun #3F3925, --line #E3E3DE, --line-2 #D2D2CC, --line-d rgba(255,255,255,.13).
- Font variables: --display "Chillax",ui-sans-serif,system-ui,sans-serif; --text "Satoshi",ui-sans-serif,system-ui,sans-serif; --mono "DM Mono",ui-monospace,"SFMono-Regular",monospace; --ios -apple-system,"SF Pro Text",system-ui,"Helvetica Neue",Arial,sans-serif.
- Size variables: --pad clamp(16px,4vw,64px), --gap clamp(14px,1.8vw,24px), --sec clamp(120px,14vw,220px).
- Media queries: max-width 979px, max-width 640px.
- No media files.
- Script: none, CSS only.

## Content to replace
- [Group label]: the choice, for example Billing period
- [Button labels]: one word each
- [Saving note]: three or four words
- [Prices]: a monthly and a yearly figure per plan
- [Billing note]: two short lines on what is charged

## Rules
Plain, specific copy that reads as a live product; never the word sample. No shadows, glow, glass, blur, gradient text, emoji or italics. Motion moves transform and opacity, with colour, border, height and stroke transitions on state changes, and holds its end state under prefers-reduced-motion. Text passes WCAG AA.

## Output
Return the block in one piece: the markup, one style block with the web fonts imported on its first line, and a small script only if the behaviour needs one. No page wrapper, no framework, no build step. Prefix every class with `blk-` and put the colours and sizes in CSS variables at the top.

More like this

Controls

Every controls block

Same page

More from Tally

See the page