Show More

Long content clamped to a few lines, with a button to show the rest.

AP
Ada Park2h

I reproduced the double charge on staging. When a card needs 3-D Secure, the confirm step retries on the client after the redirect, and the webhook also finalizes the invoice. Both paths call finalizeInvoice, so we bill twice whenever the webhook wins the race.

The fix makes finalizing idempotent on the invoice ID and drops the client retry. It's in #2291, with a test that fires both paths within 50ms of each other. Refunds for the 14 customers affected go out tomorrow.

SR
Sam Rivera1h

Approved. Ship it behind the billing flag first.

Installation

  1. Add the registryOnce per project
  2. Add show-more

Usage

ShowMoreContent shows the first lines lines, measured in its own line height, and fades out the last. ShowMoreTrigger shows only when there's more to show, which is measured rather than guessed, so short content gets neither the fade nor the button. Before the page loads in the browser, CSS clamps the content to lines lines and fades the last of them, and keeps space for the button, so long content already looks right in the server's render. Content shorter than that gives the space back once it's measured.

Tabbing to a link in the hidden lines opens the content, so focus never lands on something out of sight. Screen readers hear all of it, open or not.

Composition

Examples

Lines and labels

lines sets how many lines show while it's closed. Give ShowMoreTrigger your own words with more and less.

What’s new in 4.2

  • Plan changes are self-serve, and take effect at the next invoice.
  • Metered usage is out of beta, with alerts at 80% and 100% of a limit.
  • SSO comes with every paid plan, through Okta, Google or Azure.
  • Audit logs export to your own S3 bucket every night.
  • Invoices come as PDFs in nine languages.
  • Webhooks retry with backoff for up to three days.

Props

ShowMore

ShowMoreTrigger

ShowMoreTrigger takes the props of Button too, and is a ghost button by default.