BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/blode/ui/attachment

Attachment

blode-ui/attachment
FreeComponent

A card for files and images with upload, processing, error, and done states, an optional full-card trigger, and a scrollable group.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/mblode/blode-ui/main/public/r/attachment.json

Source

ui/attachment.tsxraw.githubusercontent.com/mblode/blode-ui/main/public/r/attachment.json
1import { mergeProps } from "@base-ui/react/merge-props";
2import { useRender } from "@base-ui/react/use-render";
3import { cva } from "class-variance-authority";
4import type { VariantProps } from "class-variance-authority";
5import type * as React from "react";
6
7import { cn } from "@/lib/utils";
8import { Button } from "@/components/ui/button";
9
10const attachmentVariants = cva(
11 "group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-2xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/30 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed",
12 {
13 variants: {
14 orientation: {
15 horizontal: "min-w-40 items-center",
16 vertical: "w-24 flex-col has-data-[slot=attachment-content]:w-30",
17 },
18 size: {
19 default:
20 "gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",
21 sm: "gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",
22 xs: "gap-1.5 rounded-xl text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1",
23 },
24 },
25 },
26);
27
28const Attachment = ({
29 className,
30 state = "done",
31 size = "default",
32 orientation = "horizontal",
33 ...props
34}: React.ComponentProps<"div"> &
35 VariantProps<typeof attachmentVariants> & {
36 state?: "idle" | "uploading" | "processing" | "error" | "done";
37 }) => (
38 <div
39 className={cn(attachmentVariants({ orientation, size }), className)}
40 data-orientation={orientation}
41 data-size={size}
42 data-slot="attachment"
43 data-state={state}
44 {...props}
45 />
46);
47
48const attachmentMediaVariants = cva(
49// … truncated

What it pulls in

npm packages

  • @base-ui/react

Other registry items

  • button

Files it writes

  • registry/default/ui/attachment.tsx

Facts

Registry
blode/ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-04
Last confirmed
today

Go to the source

blode.co mblode/blode-ui on GitHub Raw registry item This item as JSON

More from blode/ui

All 85 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordionblode/uiComponentsFree2 deps
Alertalertblode/uiComponentsFreeno deps
Alert Dialogalert-dialogblode/uiComponentsFree1 dep
Ask User Questionsask-user-questionsblode/uiComponentsFree1 dep
Aspect Ratioaspect-ratioblode/uiComponentsFree1 dep
Autocompleteautocompleteblode/uiComponentsFree1 dep
Avataravatarblode/uiComponentsFree1 dep
Badgebadgeblode/uiComponentsFree1 dep
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex