ratatui_toolkit/primitives/button/constructors/
hover_style.rs

1use ratatui::style::Style;
2
3use crate::primitives::button::Button;
4
5impl Button {
6    /// Sets the hover style for the button.
7    ///
8    /// # Arguments
9    ///
10    /// * `style` - The style to apply when the button is hovered
11    ///
12    /// # Returns
13    ///
14    /// `self` for method chaining
15    ///
16    /// # Example
17    ///
18    /// ```rust
19    /// use ratatui::style::{Color, Style};
20    /// use ratatui_toolkit::Button;
21    ///
22    /// let button = Button::new("Click Me")
23    ///     .hover_style(Style::default().fg(Color::Yellow));
24    /// ```
25    pub fn hover_style(mut self, style: Style) -> Self {
26        self.hover_style = style;
27        self
28    }
29}