murad-sinatra

Token Field

Forms 3

About

A freeform tag/chip input for forms where Enter, comma, or blur commits typed text as a removable token and Backspace clears the last one.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Token Field to your project and fits it to your theme.

Code

How Token Field is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import TokenField from "@/components/ui/token-field";
import { useState } from "react";

export default function TokenFieldDemo() {
  const [tokens, setTokens] = useState<readonly string[]>(["design", "react"]);

  return (
    <div
      className="mors-scope flex min-h-[260px] w-full items-center justify-center p-10"
      style={{ background: "var(--mors-color-canvas)" }}
    >
      <div className="w-full max-w-sm">
        <TokenField label="Topics" tokens={tokens} onTokensChange={setTokens} />
      </div>
    </div>
  );
}

More by murad-sinatra

View all
  • Event Calendar

    Event Calendar

    63
  • Table

    Table

    8
  • Drawer

    Drawer

    7
  • Combobox

    Combobox

    4
  • Toggles

    Toggles

    4
  • Command Palette

    Command Palette

    3
  • Mors Card

    Mors Card

    3
  • Number Field

    Number Field

    3

More in Forms

View all
  • Premium Auth

    Premium Auth

    593
  • Contact Form

    Contact Form

    28
  • Form

    Form

    4
  • Login 1

    Login 1

    70
  • Book A Demo 1

    Book A Demo 1

    94
  • Contact Card

    Contact Card

    1.1K
  • HeroUI Field Error

    HeroUI Field Error

    13
  • Form [react-aria-components]

    Form [react-aria-components]

    19