Astryx

Astryx Token

Component

About

Token is a small, inline element for representing discrete pieces of associated data, like tags, categories, or selections. Use it to label content, show active filters, or represent removable items like selected recipients in a compose field. Astryx by Meta. Source: https://astryx.atmeta.com/components/Token

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

Code

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

Usage.tsx

'use client';

/* Copyright (c) 2026 Meta Platforms, Inc. See MIT notice in astryx-token.tsx. */

import '@/components/ui/astryx-token-utils/astryx-preview.css';
import {useState} from 'react';
import {Token} from '@/components/ui/astryx-token';
import {Stack} from '@astryxdesign/core/Layout';

const filters = [
  {label: 'Status: Open', color: 'green'},
  {label: 'Priority: High', color: 'red'},
  {label: 'Team: Design', color: 'purple'},
] as const;

function OfficialSample() {
  const [active, setActive] = useState<readonly typeof filters[number][]>(filters);
  return (
    <Stack direction="horizontal" gap={2} wrap="wrap" role="group" aria-label="Active filters">
      {active.map(filter => (
        <Token
          key={filter.label}
          label={filter.label}
          color={filter.color}
          onRemove={() => setActive(current => current.filter(item => item.label !== filter.label))}
        />
      ))}
    </Stack>
  );
}

export default function Demo() {
  return (
    <div className="astryx-demo" data-astryx-theme="neutral" data-theme="light">
      <div className="astryx-demo-content" data-centered style={{maxWidth: 410}}>
        <OfficialSample />
      </div>
    </div>
  );
}

Dependencies

More by Astryx

View all
  • Astryx Banner

    Astryx Banner

    61
  • Astryx Avatar

    Astryx Avatar

    34
  • Astryx Aspect Ratio

    Astryx Aspect Ratio

    32
  • Astryx Badge

    Astryx Badge

    30
  • Astryx Button Group

    Astryx Button Group

    29
  • Astryx Chat Composer Drawer

    Astryx Chat Composer Drawer

    27
  • Astryx Toggle Button

    Astryx Toggle Button

    17
  • Astryx Chat Tokenized Text

    Astryx Chat Tokenized Text

    10