Skip to content

feat: Update PromptField attachment design - #10493

Open
devongovett wants to merge 3 commits into
mainfrom
promptfield-design
Open

feat: Update PromptField attachment design#10493
devongovett wants to merge 3 commits into
mainfrom
promptfield-design

Conversation

@devongovett

Copy link
Copy Markdown
Member

Updates the Attachment component to match the latest designs. There is a new background effect, errors and loading states replace the preview, and there are new icons for various file types. This is all in a new AttachmentPreview component, which replaces putting an Image inside Attachment directly.

Also slightly increased the opacity of the pixel loader icon.

const onlyPreview = ':not(:has([data-slot=content])):not(:has([data-slot=preview]))';
const noDescription = ':not(:has([slot=description]))';

const container = {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Goal is for this to eventually be a reusable style macro for custom containers using this style, so I pulled it out as a constant for now. Will work on that more next week.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha, we're going to be so overloaded on the name "container", that's already a layout template set of tokens as well

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh idk what the name will be yet

@rspbot

rspbot commented Aug 21, 2026

Copy link
Copy Markdown

@rspbot

rspbot commented Aug 21, 2026

Copy link
Copy Markdown
## API Changes

@react-spectrum/ai

/@react-spectrum/ai:AttachmentPreview

+AttachmentPreview {
+  UNSAFE_className?: UnsafeClassName
+  UNSAFE_style?: CSSProperties
+  alt?: string
+  crossOrigin?: 'anonymous' | 'use-credentials'
+  decoding?: 'async' | 'auto' | 'sync'
+  fetchPriority?: 'high' | 'low' | 'auto'
+  group?: ImageGroup
+  height?: number
+  itemProp?: string
+  loading?: 'eager' | 'lazy'
+  mimeType: string
+  referrerPolicy?: HTMLAttributeReferrerPolicy
+  renderError?: () => ReactNode
+  slot?: string | null
+  src?: string | Array<ImageSource>
+  styles?: StyleString
+  width?: number
+}

/@react-spectrum/ai:AttachmentPreviewProps

+AttachmentPreviewProps {
+  UNSAFE_className?: UnsafeClassName
+  UNSAFE_style?: CSSProperties
+  alt?: string
+  crossOrigin?: 'anonymous' | 'use-credentials'
+  decoding?: 'async' | 'auto' | 'sync'
+  fetchPriority?: 'high' | 'low' | 'auto'
+  group?: ImageGroup
+  height?: number
+  itemProp?: string
+  loading?: 'eager' | 'lazy'
+  mimeType: string
+  referrerPolicy?: HTMLAttributeReferrerPolicy
+  renderError?: () => ReactNode
+  slot?: string | null
+  src?: string | Array<ImageSource>
+  styles?: StyleString
+  width?: number
+}

@rspbot

rspbot commented Aug 21, 2026

Copy link
Copy Markdown

Agent Skills Changes

Modified (8)
Install

React Spectrum S2:

npx skills add https://d1pzu54gtk2aed.cloudfront.net/pr/d5bf4e1b6d75f8f8b0b42c12ae15715fb1e9d3b1/

React Aria:

npx skills add https://d5iwopk28bdhl.cloudfront.net/pr/d5bf4e1b6d75f8f8b0b42c12ae15715fb1e9d3b1/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants