Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

Add a compact size to the shared dropdown

Juan Denisd194d5d2ab6b
diff --git a/frontend/src/components/ui/select.jsx b/frontend/src/components/ui/select.jsx
index 948fcb7e..7081a1d8 100644
--- a/frontend/src/components/ui/select.jsx
+++ b/frontend/src/components/ui/select.jsx
@@ -7,10 +7,12 @@ const Select = SelectPrimitive.Root;
const SelectGroup = SelectPrimitive.Group;
const SelectValue = SelectPrimitive.Value;
-const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => (
+// size="sm" is the compact trigger for toolbars, table footers and inline
+// rows: content-width and 30px tall instead of a full-width 40px form field.
+const SelectTrigger = React.forwardRef(({ className, children, size, ...props }, ref) => (
<SelectPrimitive.Trigger
ref={ref}
- className={cn('ui-select-trigger', className)}
+ className={cn('ui-select-trigger', size === 'sm' && 'ui-select-trigger--sm', className)}
{...props}
>
{children}
diff --git a/frontend/src/styles/components/_ui.scss b/frontend/src/styles/components/_ui.scss
index b98ff2e6..05b9f815 100644
--- a/frontend/src/styles/components/_ui.scss
+++ b/frontend/src/styles/components/_ui.scss
@@ -510,6 +510,17 @@
color: $text-tertiary;
flex-shrink: 0;
}
+
+ &--sm {
+ width: auto;
+ height: 30px;
+ padding-block: 0;
+ padding-inline: $space-2;
+ gap: $space-1;
+ font-size: $font-size-sm;
+
+ .ui-select-icon { width: 14px; height: 14px; }
+ }
}
.ui-select-content {