Docs Components Assistant

ComposerAddAttachment

React example follows below.
ts
import { ComposerAddAttachment } from "@grassroot/ui-react/assistant";
export default function ComposerAddAttachmentDemo() {
return <ComposerAddAttachment accept="image/*,application/pdf" multiple={true}>Add attachment</ComposerAddAttachment>;
}
ts
<script setup lang="ts">
import { ComposerAddAttachment } from "@grassroot/ui-vue/assistant";
</script>
<template>
<ComposerAddAttachment accept="image/*,application/pdf" :multiple="true">Add attachment</ComposerAddAttachment>
</template>
ts
import "./ensure-compiler";
import { ChangeDetectionStrategy, Component } from "@angular/core";
import { GrassrootComposerAddAttachment } from "@grassroot/ui-angular/assistant";
@Component({
selector: "app-composer-add-attachment-demo",
standalone: true,
imports: [GrassrootComposerAddAttachment],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<grassroot-composer-add-attachment accept="image/*,application/pdf" [multiple]="multiple">Add attachment</grassroot-composer-add-attachment>`,
})
export class ComposerAddAttachmentDemoComponent {
protected readonly multiple = true;
}
export default ComposerAddAttachmentDemoComponent;
ts
<script lang="ts">
import { ComposerAddAttachment } from "@grassroot/ui-svelte/assistant";
</script>
<ComposerAddAttachment accept="image/*,application/pdf" multiple={true}>Add attachment</ComposerAddAttachment>
ts
/** @jsxImportSource solid-js */
import { ComposerAddAttachment } from "@grassroot/ui-solid/assistant";
export default function ComposerAddAttachmentDemo() {
return <ComposerAddAttachment accept="image/*,application/pdf" multiple={true}>Add attachment</ComposerAddAttachment>;
}

Installation

API Reference

Import

import { ComposerAddAttachment } from "@grassroot/ui-react/assistant";

Props

Prop
Type
Default
Requirement
accept
string | undefined
optional
multiple
boolean | undefined
optional
onAdd
((files: File[]) => void) | undefined
optional
Prop
accept
Type
string | undefined
Default
Requirement
optional
Prop
multiple
Type
boolean | undefined
Default
Requirement
optional
Prop
onAdd
Type
((files: File[]) => void) | undefined
Default
Requirement
optional

Events

EventPayload
onAdd((files: File[]) => void) | undefined

Content regions

  • children

Native attributes

Standard DOM and ARIA attributes not listed above spread onto the root element.

Import

import { ComposerAddAttachment } from "@grassroot/ui-vue/assistant";

Props

Prop
Type
Default
Requirement
accept
string
optional
multiple
boolean
true
optional
Prop
accept
Type
string
Default
Requirement
optional
Prop
multiple
Type
boolean
Default
true
Requirement
optional

Events

EventPayload
add(File[]) => void

Content regions

  • default

Import

import "./ensure-compiler";
import { ChangeDetectionStrategy, Component } from "@angular/core";
import { GrassrootComposerAddAttachment } from "@grassroot/ui-angular/assistant";

Props

Prop
Type
Default
Requirement
accept
string
optional
multiple
boolean
true
optional
Prop
accept
Type
string
Default
Requirement
optional
Prop
multiple
Type
boolean
Default
true
Requirement
optional

Events

EventPayload
addFile[]

Content regions

  • default

Import

import { ComposerAddAttachment } from "@grassroot/ui-svelte/assistant";

Props

Prop
Type
Default
Requirement
accept
string
optional
multiple
boolean
true
optional
onAdd
(files: File[]) => void
optional
class
string
optional
style
string
optional
Prop
accept
Type
string
Default
Requirement
optional
Prop
multiple
Type
boolean
Default
true
Requirement
optional
Prop
onAdd
Type
(files: File[]) => void
Default
Requirement
optional
Prop
class
Type
string
Default
Requirement
optional
Prop
style
Type
string
Default
Requirement
optional

Events

EventPayload
onAdd(files: File[]) => void

Content regions

  • children

Import

import { ComposerAddAttachment } from "@grassroot/ui-solid/assistant";

Props

Prop
Type
Default
Requirement
accept
string
optional
multiple
boolean
optional
onAdd
(files: File[]) => void
optional
Prop
accept
Type
string
Default
Requirement
optional
Prop
multiple
Type
boolean
Default
Requirement
optional
Prop
onAdd
Type
(files: File[]) => void
Default
Requirement
optional

Events

EventPayload
onAdd(files: File[]) => void

Content regions

  • children

Native attributes

Standard DOM and ARIA attributes not listed above spread onto the root element.