Expand description
Core utilities and shared types for HeroGPUI.
Modules§
- element_
id - How a component mints the
ElementIds it hands to gpui.
Structs§
- Number
Format - The
formatOptionssubset these components use. - Shared
String - A shared string is an immutable string that can be cheaply cloned in GPUI
tasks. Essentially an abstraction over an
Arc<str>and&'static str, currently backed by aSmolStr. - Unknown
Color Error - The error
Color’sFromStrreturns for a name that is not one of the five v3 role tokens.
Enums§
- Backdrop
- Overlay scrim style —
Modal,DrawerandAlertDialog. - Color
- Semantic color roles — HeroUI v3.
- Currency
Sign Intl.NumberFormatOptions["currencySign"].- Field
Variant - Form-control emphasis —
primarycarries the field shadow,secondaryis the flat low-emphasis style for use inside aSurface. - Number
Style Intl.NumberFormatOptions["style"].- Orientation
- Orientation for separators, toolbars, sliders and groups.
- Placement
placement— where a floating panel sits relative to its trigger.- Placement
Align - How a panel lines up along the trigger’s cross axis.
- Prominence
- Container prominence —
SurfaceandCard.Separatoruses the same ladder minustransparent. - Selection
Behavior - How a multi-select collection changes selection when an item is activated.
- Selection
Mode - How many items a collection lets the user select.
- Size
- The
sm | md | lgscale used by most components. - SizeXl
- The
xs | sm | md | lg | xlscale used bySpinner,ColorSwatchandColorSwatchPicker. - Unit
Display Intl.NumberFormatOptions["unitDisplay"].- Variant
- Button emphasis variant —
Button, and the vocabularyButtonGroupinherits to its direct children (the pinned group context takesButtonProps["variant"], every value on this enum).
Functions§
- mix
- Blends two colors in premultiplied sRGB space. Retained for gradients and other places where perceptual mixing is not wanted.
- mix_
oklab - CSS
color-mix(in oklab, a (1-t), b t). - oklch
- Builds a color from CSS
oklch(l c h). - oklcha
oklchwith an explicit alpha.- readable_
color - Picks black or white for maximal contrast against
background, matchingreadableColorfrom color2k as used by HeroUI. - soft_
mix - CSS
color-mix(in oklab, color p%, transparent)— the*-softfamily. - with_
alpha - Returns
colorwith its alpha channel set toalpha.