grasscnGitHub

Attachment

World archive presentation with explicit preview and remove actions.

Preview

New World.zipOverworld save 2.4 MB
0 previews
Loading example...
To run this copied example, install these items using the linked CLI or manual instructions:

Usage

The example reports preview activations and removes/restores the attachment in local state. Supply an aria-label to AttachmentTrigger and each icon-only AttachmentAction. The component does not upload or process files.

Composition

Compose Media, Content, Title and Description, then Trigger and Actions. Empty Media uses the packaged world thumbnail. Root defaults to state done, horizontal orientation, scale 2 and default size. selected and disabled are independent props; disabled cancels attachment interactions.

Interaction and limits

States idle/uploading/processing/error/done describe presentation only. Your application owns upload progress, file permissions and backend effects. Custom media and attachment action layout are web compositions; the copied example requires no external thumbnail server.

See Item for the related world-row composition and Message for chat integration.

Installation

Loading registry address

Component source

This is the component implementation. Its supporting styles, helpers and resources are also required. See complete manual installation.

Component implementationcomponents/ui/attachment.tsx · tsx
"use client";

import * as React from "react";

import { Button } from "./button";
import { MinecraftItemMedia } from "./minecraft-item-media";
import { MinecraftItemText } from "./minecraft-item-text";
import type { MinecraftItemTextProps } from "./minecraft-item-text";
import {
  minecraftClasses as cn,
  minecraftStyle,
  MinecraftRender,

Interactive playground

New World.zipOverworld save 2.4 MB
Previewed 0 times