Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/listbox-checkbox-primary-line.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@launchpad-ui/components': patch
---

Align the multi-select `ListBoxItem` checkbox to the item's primary line instead of vertically centering it against the whole item, so items with a stacked label and description keep the checkbox next to the label.
2 changes: 1 addition & 1 deletion packages/components/src/ListBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const ListBoxItem = <T extends object>({ ref, ...props }: ListBoxItemProps<T>) =
<>
{selectionMode === 'multiple' && (
<div
className={checkboxStyles()}
className={checkboxStyles({ className: styles.checkbox })}
data-selected={isSelected || undefined}
data-disabled={isDisabled || undefined}
>
Expand Down
9 changes: 9 additions & 0 deletions packages/components/src/styles/ListBox.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

.item {
composes: item from './Menu.module.css';

&:has(.checkbox) {
align-items: start;
}

& .checkbox {
height: 1lh;
align-items: center;
}
}

.content {
Expand Down
Loading