<content-button>
A link or button. Wrapped around block content, such as a card, it makes the whole area clickable, and opens a content-overlay when its href points at one.
import '@content-blocks/js/components/content-button';Examples
Three button styles
The same element styled as a solid button, an outline button and a text link.
Anatomy
Content goes into the component's slots, chosen with the slot attribute on each child.
flowchart LR root["#lt;content-button#gt;"]:::component root --> s0["<b>no slot (default)</b><br/>Default slot, same as content slot."] root --> s1["<b>slot=#quot;activatedContent#quot;</b><br/>If this slot is used, the content in this will be scrolled to and tri…"] root --> s2["<b>slot=#quot;content#quot;</b><br/>Inner contents of the button, usually plaintext."] classDef component fill:#141413,color:#faf9f5,stroke:#141413
| Slot | What goes in it |
|---|---|
(default) | Default slot, same as content slot. |
slot="activatedContent" | If this slot is used, the content in this will be scrolled to and triggered. |
slot="content" | Inner contents of the button, usually plaintext. |
Properties
Set them as attributes. Those marked responsive take a value per breakpoint, separated by pipes and named or in order: 1|tablet=2 or 1|2. Seeresponsive values.
| Attribute | Type | Default | Description |
|---|---|---|---|
classesresponsive | String | – | Classes to add to the component. Use pipes for different classes per breakpoint, by name or in order: classes="stacked|laptop=side-by-side". |
controls | Target | – | /** Aria-controls value |
expanded | Boolean | – | Not documented yet |
href | URL | – | Not documented yet |
link-classresponsive | String | – | Not documented yet |
link-labelresponsive | String | – | Not documented yet |
paddingresponsive | String | – | Padding around the component, written as CSS padding. Use pipes for different padding per breakpoint, by name or in order: padding="1rem|tablet=2rem 4rem" or padding="1rem|2rem 4rem|3rem 5rem 4rem". |
target | String | – | Not documented yet |
