Skip to content
caliper ui pro docs

Lanyard

A badge on a strap that you can pick up, swing and throw. The strap only resists stretching, so it goes slack when the card is tossed up, and the card swings and twists under its clip until it hangs straight again.

Pro
Config 26Speaker

Maya Chen

Design systems, Forma

Hall B · 14:30Lisbon, 6 Nov

When to use

  • Event passes, membership cards and sign-up confirmations: "You're in".
  • A playful profile or about page.

When not to use

  • Information people need to read at once; it is a celebration, not a record.
  • Product screens and dashboards.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/lanyard

Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

Lanyard

2 props

Also accepts the native props of its root element and a ref.

PropTypeDefaultDescription
label *string—Names the badge for assistive technology, e.g. "Maya Chen's pass".
lengthnumber150Strap length in px from the top edge to the clip.

Keyboard

←
Moves to the previous item or value.
→
Moves to the next item or value.

Accessibility

It exposes group semantics, with aria-hidden, aria-label and aria-roledescription kept in step with state.

Motion

  • State changes animate with the library's shared durations and curves, so its timing matches every other part.
  • Under reduced motion each change lands on its end state without movement; nothing is hidden or skipped.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/lanyard.md

The index of every part is at /llms.txt.

More in Surfaces