Prometheus Design System v0.2.0 — WIP

SettingsPanel

Popover panel for user settings.

Description

Popover panel for user settings. Renders as a gear icon button that opens a settings popover with grouped checkboxes and number inputs. Replaces SettingsMenu from the source.

✓ Do
  • Application-level settings (syntax highlighting, linting, time format)
  • User preferences that persist to localStorage
  • Place in the header actions area, group related settings logically
✗ Don’t
  • Page-level filters (use FilterToolbar)
  • Modal dialogs with complex forms
  • Custom popover settings outside this component

Design

SettingsPanel Popover
Query Settings
Enable syntax highlighting
Enable autocomplete
Enable linting
Display
Use local time
Show annotations

SettingGroup Interface

PropertyTypeDescription
titlestringGroup heading
settings(SettingCheckbox | SettingNumber)[]Settings in this group
Where this component exists in the Prometheus UI
View in Prometheus UI → / SettingsPanel accessed from the gear icon in the header

SettingsPanel accessed from the gear icon in the header

Implementation

From components/SettingsMenu.tsx in the Prometheus codebase:

<Popover position="bottom" withArrow shadow="md">
  <Popover.Target>
    <ActionIcon color="gray" title="Settings" size={32}>
      <IconSettings style={actionIconStyle} />
    </ActionIcon>
  </Popover.Target>
  <Popover.Dropdown>
    <Stack>
      <Fieldset p="md" legend="Global settings">
        <Checkbox checked={useLocalTime} label="Use local time"
          onChange={(e) =>
            dispatch(updateSettings({ useLocalTime: e.currentTarget.checked }))
          } />
      </Fieldset>
      <Fieldset p="md" legend="Query page settings">
        <Stack>
          <Checkbox checked={enableQueryHistory} label="Enable query history" />
          <Checkbox checked={enableAutocomplete} label="Enable autocomplete" />
          <Checkbox checked={enableSyntaxHighlighting} label="Enable syntax highlighting" />
        </Stack>
      </Fieldset>
    </Stack>
  </Popover.Dropdown>
</Popover>

Layout Specs

PropertyValue
Padding16px (1rem)
Max Width320px
Border Radius8px (md)
Border Width1px
Shadowmd (--mantine-shadow-md)
Group Title Font Size12px
Item Font Size13px
Checkbox Size16px

Accessibility