Docs Components Assistant

File

React example follows below.
ts
import { File } from "@grassroot/ui-react/assistant";
import { assistantDemoAttachments } from "@grassroot/demo-fixtures";
export default function FileDemo() {
return <File file={assistantDemoAttachments[0]} />;
}
ts
<script setup lang="ts">
import { File } from "@grassroot/ui-vue/assistant";
import { assistantDemoAttachments } from "@grassroot/demo-fixtures";
</script>
<template>
<File :file="assistantDemoAttachments[0]" />
</template>
ts
import "./ensure-compiler";
import { ChangeDetectionStrategy, Component } from "@angular/core";
import { GrassrootAssistantFile } from "@grassroot/ui-angular/assistant";
import { assistantDemoAttachments } from "@grassroot/demo-fixtures";
@Component({
selector: "app-file-demo",
standalone: true,
imports: [GrassrootAssistantFile],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<grassroot-assistant-file [file]="file" />`,
})
export class FileDemoComponent {
protected readonly file = assistantDemoAttachments[0];
}
export default FileDemoComponent;
ts
<script lang="ts">
import { File } from "@grassroot/ui-svelte/assistant";
import { assistantDemoAttachments } from "@grassroot/demo-fixtures";
</script>
<File file={assistantDemoAttachments[0]} />
ts
/** @jsxImportSource solid-js */
import { File } from "@grassroot/ui-solid/assistant";
import { assistantDemoAttachments } from "@grassroot/demo-fixtures";
export default function FileDemo() {
return <File file={assistantDemoAttachments[0]} />;
}

Installation

API Reference

Import

import { File } from "@grassroot/ui-react/assistant";
import { assistantDemoAttachments } from "@grassroot/demo-fixtures";

Props

Prop
Type
Default
Requirement
file
AssistantAttachment
—
required
Prop
file
Type
AssistantAttachment
Default
—
Requirement
required

Native attributes

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

Import

import { File } from "@grassroot/ui-vue/assistant";
import { assistantDemoAttachments } from "@grassroot/demo-fixtures";

Props

Prop
Type
Default
Requirement
file
AssistantAttachment
—
required
Prop
file
Type
AssistantAttachment
Default
—
Requirement
required

Import

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

Props

Prop
Type
Default
Requirement
file
AssistantAttachment
—
required
Prop
file
Type
AssistantAttachment
Default
—
Requirement
required

Import

import { File } from "@grassroot/ui-svelte/assistant";
import { assistantDemoAttachments } from "@grassroot/demo-fixtures";

Props

Prop
Type
Default
Requirement
file
AssistantAttachment
—
required
class
string
—
optional
style
string
—
optional
Prop
file
Type
AssistantAttachment
Default
—
Requirement
required
Prop
class
Type
string
Default
—
Requirement
optional
Prop
style
Type
string
Default
—
Requirement
optional

Content regions

  • children

Import

import { File } from "@grassroot/ui-solid/assistant";
import { assistantDemoAttachments } from "@grassroot/demo-fixtures";

Props

Prop
Type
Default
Requirement
file
AssistantAttachment
—
required
Prop
file
Type
AssistantAttachment
Default
—
Requirement
required

Content regions

  • children

Native attributes

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