Slint Kit Documentation

Navigation

KitNotificationCenter

Notification list with preview, read and removal actions by stable identity.

Notification list with preview, read and removal actions by stable identity.
Native screenshot of the same example, rendered with Skia.

Supply NotificationRow values and acknowledge activate, mark-read and dismiss-row by token and generation. Keep popup placement and mark-read-label and read-label stable during an open session.

Removal disables actions and emits the request after a 150 ms fade, omitted with reduced motion; changing identity cancels pending removal. Large collections use a virtualized list, and focus-token with focus-request can focus a preview.

Complete example

This complete Slint file is a visual composition used to produce the screenshot above. Internal strings without a label property retain the kit’s default language; system dialogs follow the host platform. Projected state and callbacks requesting a decision need host wiring; the standalone fixture does not supply that controller. Set up the Rust project, then see the typed controller application for working editing, validation and selection.

// SPDX-License-Identifier: GPL-3.0-or-later
import { KitNotificationCenter, KitTheme, KitThemes } from "@kit/kit.slint";

export component Example inherits Window {
    title: "KitNotificationCenter example";
    preferred-width: 620px;
    preferred-height: 440px;
    max-width: 100000px;
    max-height: 100000px;
    background: root.theme.canvas;
    in-out property <KitTheme> theme: KitThemes.light;
    in-out property <string> status;
    VerticalLayout {
        padding: 24px; spacing: 16px; alignment: start;
        Text { text: "Notification Center"; color: root.theme.text-primary; font-size: 20px * root.theme.text-scale; font-weight: 600; }
        KitNotificationCenter { theme: root.theme; height: 300px; rows: [{ item: { token: 11, generation: 1, label: "Jamie shared a document", description: "Research notes are ready for review.", disabled: false }, read: false }, { item: { token: 23, generation: 1, label: "Your export is ready", description: "Download the latest project archive.", disabled: false }, read: true }]; }
        if root.status != "": Text { text: root.status; color: root.theme.text-secondary; font-size: 12px * root.theme.text-scale; wrap: word-wrap; }
    }
}

Download this example

Public API

Inherits Rectangle. The declarations below come from the component source. Parent properties remain available; see the controller guide for state management.

Properties

Name Type Direction
theme KitTheme in
control-size ControlSize in
rows [NotificationRow] in
focus-token int in
focus-request int in
empty-label string in
empty-description string in
open-label string in
mark-read-label string in
read-label string in
dismiss-label string in
disabled bool in
content-height length out

Types and variants

Names below use Slint syntax. Shared Rust domain types live in slint_kit; presentation enums come from the Rust types generated by Slint.

Type Declaration
enum ControlSize compact, medium, comfortable
struct NotificationRow item: OptionRow, read: bool
struct OptionRow token: int, generation: int, label: string, description: string, disabled: bool

Callbacks

See also