Skip to main content

Module extend

Module extend 

Source
Expand description

The helpers HeroGPUI supports for building custom widgets that match the components: v3’s radius scale read from the active theme, the field metrics, the interactive cursor, the focus-visible modality, and the vanilla-GPUI workarounds the components themselves use.

Everything else the components share stays private to this crate, so its signatures can change without a breaking release.

Constants§

FIELD_HEIGHT
The one height every v3 form field has: .date-input-group and .color-input-group are h-9, and .input’s py-2 plus its line box comes to the same 36px. v3 removed size from the field components (Input, Select, ComboBox, DateField, …), keeping it only on the nineteen where a scale is documented, so a field’s metrics are constants rather than a herogpui_core::Size lookup.
FIELD_ICON
Glyph size for an icon inside a form field.
FIELD_TEXT
Type size inside a form field.

Functions§

app_focus_root
Records keyboard-versus-pointer input, and moves the focus on Tab.
container_radius
min(32px, --radius-3xl) — cards, the table, and every floating panel (modal, popover, toast, alert, dropdown). Surface is not on the list: upstream .surface declares no radius.
control_radius
rounded-3xl — buttons, toggle buttons and avatars.
cursor_interactive
Applies the theme’s interactive cursor (--cursor-interactive) to el.
field_radius
Corner radius of a form field — --field-radius.
focus_visible
Whether focus rings should currently be shown, i.e. the last interaction was keyboard-driven.
hairline_radius
rounded-sm — separators and skeletons, which are nearly square.
inner_fill_radius
Corner radius for a fill painted inside a rounded overflow_hidden clip parent on vanilla GPUI.
interactive_cursor
The theme’s interactive cursor, for a site that must capture it by value.
key_radius
rounded-lg — the keyboard key and the radio control, which v3 draws as a rounded square rather than a circle.
mark_radius
rounded-md — the checkbox control (.checkbox__control is size-4 rounded-md).
micro_radius
rounded-xs — the small ProgressBar track.
set_focus_visible
Sets whether focus rings should be shown, refreshing windows when the value changes.
shift_wheel_scroll_x
Shift+wheel horizontal scroll for mouse wheels on the web platform.
small_radius
rounded-xl — close buttons, tags, links, tooltips.
soft_radius
rounded-2xl — chips, menu and list rows, the colour area.