Class Attachment
Attachment UI element. Displays an attachment with a thumbnail area, title, subtitle, and a delete action button.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public class Attachment : BaseVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, IAdditionalDataHolder, IPressable
Constructors
Attachment()
Default constructor.
Declaration
public Attachment()
Fields
compactUssClassName
The Attachment compact styling class.
Declaration
public const string compactUssClassName = "appui-attachment--compact"
Field Value
| Type | Description |
|---|---|
| string |
deleteBtnUssClassName
The Attachment delete button styling class.
Declaration
public const string deleteBtnUssClassName = "appui-attachment__delete-btn"
Field Value
| Type | Description |
|---|---|
| string |
iconUssClassName
The Attachment icon styling class.
Declaration
public const string iconUssClassName = "appui-attachment__icon"
Field Value
| Type | Description |
|---|---|
| string |
infoUssClassName
The Attachment info container styling class.
Declaration
public const string infoUssClassName = "appui-attachment__info"
Field Value
| Type | Description |
|---|---|
| string |
readOnlyUssClassName
The Attachment read-only styling class.
Declaration
public const string readOnlyUssClassName = "appui-attachment--readonly"
Field Value
| Type | Description |
|---|---|
| string |
subtitleUssClassName
The Attachment subtitle styling class.
Declaration
public const string subtitleUssClassName = "appui-attachment__subtitle"
Field Value
| Type | Description |
|---|---|
| string |
thumbnailUssClassName
The Attachment thumbnail styling class.
Declaration
public const string thumbnailUssClassName = "appui-attachment__thumbnail"
Field Value
| Type | Description |
|---|---|
| string |
titleUssClassName
The Attachment title styling class.
Declaration
public const string titleUssClassName = "appui-attachment__title"
Field Value
| Type | Description |
|---|---|
| string |
ussClassName
The Attachment main styling class.
Declaration
public const string ussClassName = "appui-attachment"
Field Value
| Type | Description |
|---|---|
| string |
Properties
clickable
Clickable Manipulator for this Attachment.
Declaration
public Pressable clickable { get; set; }
Property Value
| Type | Description |
|---|---|
| Pressable |
compact
Whether the Attachment is in compact mode. When true (the default), the Attachment renders as a one-line row using icon instead of the thumbnail container.
Declaration
public bool compact { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
contentContainer
The content container of the Attachment. Returns the thumbnail container
so that attachment.Add(element) adds elements to the thumbnail area.
Declaration
public override VisualElement contentContainer { get; }
Property Value
| Type | Description |
|---|---|
| VisualElement |
Overrides
icon
The Icon displayed in compact mode. Configure via icon.iconName and icon.variant.
Declaration
public Icon icon { get; }
Property Value
| Type | Description |
|---|---|
| Icon |
readOnly
Whether the Attachment is in read-only mode. When true, the delete button is hidden.
Declaration
public bool readOnly { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
subtitle
The subtitle text of the attachment.
Declaration
public string subtitle { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
title
The title text of the attachment.
Declaration
public string title { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Events
clicked
The Attachment click event.
Declaration
public event Action clicked
Event Type
| Type | Description |
|---|---|
| Action |
deleteClicked
Event invoked when the delete button is clicked.
Declaration
public event Action deleteClicked
Event Type
| Type | Description |
|---|---|
| Action |