Label(props: { title: string | Component; icon?: Component; systemImage?: string }): Component;
Parameters
The label text. Can be a plain string or a component for custom styling.
Optional custom icon component to display alongside the text.
Optional system image name to use as the icon.
Support
Usage
Text-only label
Label({
title: "Settings"
})
Label with system image
Label({
title: "Favorite",
systemImage: "star.fill"
})
Label with custom icon
Label({
title: "Download",
icon: Image({ systemName: "arrow.down.circle" })
.foregroundStyle(Color("blue"))
})
Label with styled text
Label({
title: Text("Important")
.font("headline")
.foregroundStyle(Color("red")),
systemImage: "exclamationmark.triangle"
})
Label in lists
List([
Label({
title: "Messages",
systemImage: "message"
}),
Label({
title: "Calendar",
systemImage: "calendar"
}),
Label({
title: "Photos",
systemImage: "photo"
})
])