tauri-plugin-liquid-glass 0.1.6

macOS 26+ Liquid Glass effect support for Tauri
Documentation
use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};

/// Configuration for the liquid glass effect
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase", default)]
pub struct LiquidGlassConfig {
    /// Whether the glass effect is enabled
    pub enabled: bool,

    /// Corner radius for the glass view in pixels
    pub corner_radius: f64,

    /// Tint color in hex format (#RRGGBB or #RRGGBBAA)
    pub tint_color: Option<String>,

    /// Glass material variant (experimental)
    pub variant: GlassMaterialVariant,
}

impl Default for LiquidGlassConfig {
    fn default() -> Self {
        Self {
            enabled: true,
            corner_radius: 0.0,
            tint_color: None,
            variant: GlassMaterialVariant::default(),
        }
    }
}

/// Glass material variants for NSGlassEffectView
///
/// These variants control the appearance of the liquid glass effect.
/// Note: These are experimental and may change in future macOS versions.
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize_repr, Deserialize_repr)]
#[repr(i64)]
pub enum GlassMaterialVariant {
    #[default]
    Regular = 0,
    Clear = 1,
    Dock = 2,
    AppIcons = 3,
    Widgets = 4,
    Text = 5,
    Avplayer = 6,
    Facetime = 7,
    ControlCenter = 8,
    NotificationCenter = 9,
    Monogram = 10,
    Bubbles = 11,
    Identity = 12,
    FocusBorder = 13,
    FocusPlatter = 14,
    Keyboard = 15,
    Sidebar = 16,
    AbuttedSidebar = 17,
    Inspector = 18,
    Control = 19,
    Loupe = 20,
    Slider = 21,
    Camera = 22,
    CartouchePopover = 23,
}