AddTile

AddTile

HkAddTile is the dashed tile that invites an action — the empty state of a list or a panel, the "add one more" row at the end of a list, the drop zone for files. It is one element with three shapes: the centered block (the default), the slim compact row, and the droppable zone that also accepts file drags.

  • The page's primary action is a Button or an HkFab; the add tile is for growing the content that is already on the screen.
  • For a menu of several things to add, use a button with a menu; the tile carries one action.

Import

tsx
1
import { HkAddTile } from "@celestia-island/hikari";

This component ships in the Vue library only; it has no Rust mirror.

Empty state

The default tile is a centered block — glyph above the caption — and the whole tile is the click target. disabled switches it off entirely.

TSX

List end

compact turns the tile into a slim start-aligned row that reads as the last member of a list instead of a button floating under it.

TSX
Field: Title
Field: Owner

Interaction

click fires from the whole tile. The example appends a row on every press.

TSX
Field: Title
Field: Owner

Drop zone

droppable accepts file drags: the tile takes on the drag-over wash while files are over it, and a drop with at least one file emits drop-files with the File[] and the native event. Drops of anything but files are ignored, so the event always carries at least one file. The host decides what the files mean. Note the handler's name: the event is declared drop-files, so in TSX its prop is onDrop-files.

TSX

No files yet.

API

Vue

Props

NameTypeDefaultRequired
disabledBooleanfalse—
droppableBooleanfalse—
compactBooleanfalse—
icon[Object, Function] as PropType<Component>undefined—

Emits

EventPayload
clickMouseEvent
drop-filesFile[], DragEvent

Accessibility

  • The tile is a real <button type="button">: it is focusable and reacts to Enter and Space; the caption is its accessible name.
  • A disabled tile refuses drags as well as clicks — it never cancels dragover, so the browser disallows the drop.
  • icon takes a component (lucide style); an icon slot replaces the default glyph with any renderable node.

Related components

  • Button — an action that is not tied to a list.
  • HkFab — the page-wide "create" action.