Overflow List
One row of actions or links that shows what fits and folds the rest into a "More" menu, refitting as its width changes.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
collapse-from | 'end' | 'start' | end | The edge whose children fold first; the trigger sits on that edge. |
min-visible | number | 0 | Children kept in the row even when they do not fit. |
max-visible | number | undefined | undefined | Most children to show, whatever the room. Unset shows as many as fit. |
placement | Placement | undefined | undefined | Placement of the menu. Defaults to bottom-end, or bottom-start when collapsing from the start. |
Slots
| Name | Description |
|---|---|
(default) | The children: c2-button, c2-icon-button, c2-link-button, links, any element, and hr / c2-separator between groups. |
menu | c2-menu-item rows always listed in the menu, after the folded children. Their menu-select events bubble as usual. |
more | Content of the trigger, replacing the ⋯ icon (for example the text "More" and a chevron). The trigger keeps its counted name. |
Events
| Name | Type | Description |
|---|---|---|
overflow-change | CustomEvent<OverflowListChangeDetail> | The number of folded children changed. detail has visibleCount and hiddenCount. Does not bubble. |
CSS parts
Shadow DOM styling hooks used with ::part(name). Prefer CSS custom properties when they cover the change.
| Name | Description |
|---|---|
row | The flex row holding the visible children and the trigger. |
more | The trigger, a native button that opens the menu. |
CSS custom properties
Grouped by semantic target and state from --c2-<component>__<target>__<state>--<property>. Click a group to collapse it; click a name to copy it.
| Name | Type | Default | Description |
|---|---|---|---|
--c2-overflow-list--gap | pixel | 8px | Space between the children and before the trigger, included in the fit. |
--c2-overflow-list--align-items | align-items | center | |
--c2-overflow-list__more--height | pixel | 36px | |
--c2-overflow-list__more--min-width | pixel | 36px | |
--c2-overflow-list__more--padding-left | padding | 8px | |
--c2-overflow-list__more--padding-right | padding | 8px | |
--c2-overflow-list__more--gap | pixel | 4px | Space between the parts of slotted more content. |
--c2-overflow-list__more--border | border | 1px solid #bcbcc6 | |
--c2-overflow-list__more--border-radius | border-radius | 6px | |
--c2-overflow-list__more--background-color | color | transparent | |
--c2-overflow-list__more--color | color | #18181b | |
--c2-overflow-list__more--font-family | font-family | inherit | |
--c2-overflow-list__more--font-size | pixel | 14px | |
--c2-overflow-list__more--font-weight | font-weight | 500 | |
--c2-overflow-list__more--icon-size | pixel | 18px | Size of the default ⋯ icon. |
--c2-overflow-list__more__hover--background-color | color | #f4f4f5 | Also the background while the menu is open. |
--c2-overflow-list__more__hover--border | border | 1px solid #a1a1aa | |
--c2-overflow-list__more__focus--outline | outline | 2px solid rgba(2, 101, 220, 0.4) | |
--c2-overflow-list__more__focus--outline-offset | pixel | 2px | |
--c2-overflow-list__more__current--color | color | rgb(2, 101, 220) | Trigger text while a folded child is the current item. |
--c2-overflow-list__more__current--border | border | 1px solid rgb(2, 101, 220) | |
--c2-overflow-list__current-item--font-weight | font-weight | 600 | Weight of the menu row of the current item. |
--c2-overflow-list__separator--color | color | #e4e4e7 | Colour of an hr child between groups in the row. |
--c2-overflow-list__separator--margin | margin | 4px 0 | |
Text and languages
The text the component shows, in English. It shows another language when the app adds one with addTranslations, under overflow-list, and the nearest lang asks for it; any message not translated stays in English. {0}, {1}… stand for the values a message carries. Languages guide.
| Key | English | Values |
|---|---|---|
moreItems | {0} more items | {0} count |
moreItemsCurrent | {0} more items, including current item | {0} count |
more | More items | — |