Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(ui): stop checkboxes stretching to the full width of a form field

yatishgoel054acb2223cb
diff --git a/ui/litellm-dashboard/src/components/CreateUserButton.test.tsx b/ui/litellm-dashboard/src/components/CreateUserButton.test.tsx
index 3777c46973f..46c66ee9ef6 100644
--- a/ui/litellm-dashboard/src/components/CreateUserButton.test.tsx
+++ b/ui/litellm-dashboard/src/components/CreateUserButton.test.tsx
@@ -294,6 +294,21 @@ describe("CreateUserButton", () => {
});
});
+ it("lays the send invitation email checkbox out beside its label", async () => {
+ const user = userEvent.setup({ pointerEventsCheck: PointerEventsCheckLevel.Never });
+ renderWithProviders(<CreateUserButton {...defaultProps} />);
+
+ await waitFor(() => {
+ expect(screen.getByRole("button", { name: /\+ invite user/i })).toBeInTheDocument();
+ });
+ await user.click(screen.getByRole("button", { name: /\+ invite user/i }));
+
+ const dialog = screen.getByRole("dialog", { name: /invite user/i });
+ const checkbox = within(dialog).getByRole("checkbox");
+
+ expect(checkbox.closest('[data-slot="field"]')).toHaveAttribute("data-orientation", "horizontal");
+ });
+
describe("organizations", () => {
it("should send organizations list in POST body when organizations are selected", async () => {
const { useOrganizations } = await import("@/app/(dashboard)/hooks/organizations/useOrganizations");
diff --git a/ui/litellm-dashboard/src/components/CreateUserButton.tsx b/ui/litellm-dashboard/src/components/CreateUserButton.tsx
index e052a9e0818..0f7c356b8cc 100644
--- a/ui/litellm-dashboard/src/components/CreateUserButton.tsx
+++ b/ui/litellm-dashboard/src/components/CreateUserButton.tsx
@@ -270,7 +270,7 @@ export const CreateUserButton: React.FC<CreateuserProps> = ({
);
const sendInviteEmailField = (
- <FormField control={form.control} name="send_invite_email" label="Send invitation email">
+ <FormField control={form.control} name="send_invite_email" label="Send invitation email" orientation="horizontal">
{({ id, value, onChange, onBlur }) => (
<Checkbox id={id} checked={value} onCheckedChange={onChange} onBlur={onBlur} />
)}
diff --git a/ui/litellm-dashboard/src/components/Settings/AdminSettings/SSOSettings/Modals/BaseSSOSettingsForm.tsx b/ui/litellm-dashboard/src/components/Settings/AdminSettings/SSOSettings/Modals/BaseSSOSettingsForm.tsx
index 5216da382d0..cb97304f77a 100644
--- a/ui/litellm-dashboard/src/components/Settings/AdminSettings/SSOSettings/Modals/BaseSSOSettingsForm.tsx
+++ b/ui/litellm-dashboard/src/components/Settings/AdminSettings/SSOSettings/Modals/BaseSSOSettingsForm.tsx
@@ -303,7 +303,7 @@ const SSOProviderField = ({ field }: { field: SSOProviderConfig["fields"][number
if (field.type === "checkbox") {
return (
- <FormField control={control} name={field.name} label={field.label}>
+ <FormField control={control} name={field.name} label={field.label} orientation="horizontal">
{({ value, onChange, onBlur, id, ...rest }) => (
<Checkbox
id={id}
@@ -413,7 +413,7 @@ export const MappingToggleField = ({
const { control } = useFormContext<SSOSettingsFormValues>();
return (
- <FormField control={control} name={name} label={label}>
+ <FormField control={control} name={name} label={label} orientation="horizontal">
{({ value, onChange, onBlur, id, ...rest }) => (
<Checkbox
id={id}