Components
Link button
A button that reads as an inline text link: Show more, Retry. --block spans the row with a full tap target.
Live example
Rendered with the real classes from /site/chitransit.css, light (left) and dark (right).
.ct-link-button.ct-link-button--blockCode
<button class="ct-link-button" type="button">Show more</button>
<button class="ct-link-button ct-link-button--block" type="button">Show all 24 stops</button>
Tokens
From tokens/components.tokens.json. Override one instance by setting the property without the ct- prefix.
| Custom property | Value | Alias | Resolves to |
|---|---|---|---|
--ct-link-button-color | var(--accent) | {colors.accent} | #0B4EA2 #92B8F5 |
--ct-link-button-color-hover | var(--accent-hover) | {colors.accentHover} | #0C4691 #A0C1F5 |
--ct-link-button-font-size | var(--fs-sub) | {type.sub} | 13 |
--ct-link-button-font-weight | var(--weight-semibold) | {weight.semibold} | 600 |
--ct-link-button-min-height-block | var(--size-minimum-tap-target) | {size.minimumTapTarget} | 44 pt |
--ct-link-button-min-height | 24px |
Variants
.ct-link-button is the inline default; --block spans the row, left-aligned, for a Show all row at the end of a list. Nothing else exists. A standalone low-emphasis action beside other buttons is a Button --plain.
<!-- Do -->
<button class="ct-link-button" type="button">Show 12 more</button>
<!-- Don't: a link button that navigates; use <a> -->
<button class="ct-link-button" type="button" onclick="location.href='/stops'">All stops</button>
Usage
Do
- Use a link button for an inline text action in running copy or under content: Show more, Retry, Details. A standalone low-emphasis action beside other buttons is a Button
--plain. - Use
--blockfor a full-width Show all row at the end of a list. - On phones raise the tap target: set
--link-button-min-heighttovar(--size-minimum-tap-target).
Don't
- Don't use it to navigate to another page; use a link (
<a>). - Don't use it for the main action of a page or dialog; use a button.
Accessibility
- It is a real
<button type="button">, so it is focusable and announced as a button. - Its label says what happens (Show 12 more), not Click here.