pub struct Styles {
pub ellipsis: Style,
pub short_key: Style,
pub short_desc: Style,
pub short_separator: Style,
pub full_key: Style,
pub full_desc: Style,
pub full_separator: Style,
}Expand description
A set of styles for the help component.
This structure defines all the visual styling options available for customizing the appearance of the help view. Each field controls a specific visual element, allowing fine-grained control over colors, formatting, and visual hierarchy.
§Style Categories
§Short Help Styles
short_key: Styling for key names in compact viewshort_desc: Styling for descriptions in compact viewshort_separator: Styling for bullet separators between items
§Full Help Styles
full_key: Styling for key names in detailed viewfull_desc: Styling for descriptions in detailed viewfull_separator: Styling for spacing between columns
§Utility Styles
ellipsis: Styling for truncation indicator when content is too wide
§Examples
§Custom Color Scheme
use bubbletea_widgets::help::Styles;
use lipgloss_extras::prelude::*;
let vibrant_styles = Styles {
short_key: Style::new()
.foreground(Color::from("#FF6B6B"))
.bold(true),
short_desc: Style::new()
.foreground(Color::from("#4ECDC4"))
.italic(true),
short_separator: Style::new()
.foreground(Color::from("#45B7D1")),
..Default::default()
};§Monochrome Theme
let mono_styles = Styles {
short_key: Style::new().bold(true),
short_desc: Style::new().faint(true),
full_key: Style::new().underline(true),
full_desc: Style::new(),
..Default::default()
};§Using with Help Model
let custom_styles = Styles {
short_key: Style::new().foreground(Color::from("#00FF00")),
..Default::default()
};
let help = Model {
styles: custom_styles,
..Default::default()
};Fields§
§ellipsis: StyleStyle for the ellipsis character when content is truncated.
short_key: StyleStyle for key names in the short help view.
short_desc: StyleStyle for descriptions in the short help view.
short_separator: StyleStyle for the separator between items in the short help view.
full_key: StyleStyle for key names in the full help view.
full_desc: StyleStyle for descriptions in the full help view.
full_separator: StyleStyle for the separator between columns in the full help view.
Trait Implementations§
Source§impl Default for Styles
impl Default for Styles
Source§fn default() -> Self
fn default() -> Self
Creates default styles with a subtle color scheme that adapts to light and dark themes.
The default styling uses adaptive colors that work well in both light and dark terminal environments:
§Color Palette
- Keys: Medium gray (light: #909090, dark: #626262) - provides good visibility for key names
- Descriptions: Lighter gray (light: #B2B2B2, dark: #4A4A4A) - subtle but readable for descriptions
- Separators: Even lighter gray (light: #DDDADA, dark: #3C3C3C) - minimal visual interruption
§Adaptive Behavior
The colors automatically adapt based on the terminal’s background:
- Light terminals: Use darker colors for good contrast
- Dark terminals: Use lighter colors for readability
This ensures consistent readability across different terminal themes without requiring manual configuration.
§Examples
use bubbletea_widgets::help::Styles;
let styles = Styles::default();
// All styles are configured with adaptive colors suitable for terminals
// The actual style strings contain color codesAuto Trait Implementations§
impl Freeze for Styles
impl !RefUnwindSafe for Styles
impl Send for Styles
impl Sync for Styles
impl Unpin for Styles
impl !UnwindSafe for Styles
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle.Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other into Self, while performing the appropriate scaling,
rounding and clamping.Source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
T.Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Source§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self into T, while performing the appropriate scaling,
rounding and clamping.Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds error is returned which contains
the unclamped color. Read more