AsterUIDocsv1.0.2

Docs / Component reference

MentionInput

Type an @ followed by a name to narrow the choices and insert a mention into a message.

Mention input example

Install

sh
npx @fierst/ui@1.0.2 add mention-input

Registry dependencies: theme.

Exports from ./ui/mention-input: MentionCandidate, MentionInput.

Download the registry source for mention-input 1.0.2.

API contracts

ts
export interface MentionCandidate {
  handle: string;
  name: string;
}

export function* MentionInput(
  props: {
    label?: string;
    candidates: readonly MentionCandidate[];
    value?: string;
    defaultValue?: string;
    placeholder?: string;
    onChange?: (val: string) => void;
    class?: string;
  },
  ctx: Ctx,
)