Toggle
A button that stays on or off, such as a filter over a list or a tool in a toolbar.
Examples
- Northgate CreditOct 14
- Harbor Lane PartnersOct 9
- Elm Street ValueSep 30
- Westbrook IncomeSep 26
26 events
Variants
Look
- Flood exposure in coastal mortgagesPapers
- Carbon pricing and bank lendingPapers
Pill, the grey fill at rest, for a filter over a list among other filters, any number on.Notes for the quarterly review. *Ask about the move into private credit* before the call with the fund's managers.
Toggle, no fill at rest, for a tool in a toolbar that stays pressed while it applies.Size
Lists
- Reading list
- Q3 13F filings
- Climate risk papers
--control-sm tall (32px), for a toggle in a dense row such as a table toolbar.This week
- Fund managers forum09:30
- Credit outlook briefing13:00
- Quarterly review16:00
--control-sm, for a dense header.States
Usage
Use it when
- A filter or an option over content that you turn on and off, and any number can be on. Use
Pill. - A tool that stays pressed while it applies and is pressed again to stop, such as showing a list's dates, a preview or wrapped lines. Use
Toggle, in a toolbar beside the content it changes.
Use something else when
- Exactly one of several must be pressed. Use SegmentedControl instead, a radio group.
- The choice navigates to a filtered page. Use ChipRow instead, links that wear
pillClasses. - The state only applies on Save. Use Checkbox instead; a toggle that waits for Save is a checkbox.
- The press starts an action. Use Button instead.
- The control is a setting with two sides that applies at once and is read as on or off, such as notifications. Use Switch instead.
- The press keeps a thing for later. Use SaveToggle instead.
Rules
General
Content
Avoid
Limits
Install
npx shadcn@latest add https://kaanarici.com/r/cobalt/toggle.json https://kaanarici.com/r/cobalt/pill.jsonimport { Toggle, toggleVariants } from "@/components/cobalt/ui/toggle"import { Pill, pillClasses, pillLabel } from "@/components/cobalt/ui/pill"Related
- FilterBarfilter pills over a list, each naming what is chosen, that fold into one sheet on a phone.
- IconButtonnames a button that is only an icon once, so the one string is read aloud by a screen reader and shown on hover as the tooltip.
- StateButtonan action that reports its request inside the button.
