Astryx

Astryx Code

Component

About

Code marks short inline references such as function names, variables, file paths, and command-line flags. Use CodeBlock for standalone or multi-line snippets.

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

Code

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

Usage.tsx

'use client';

import {Code} from '@/components/ui/astryx-code';
import {Text} from '@astryxdesign/core/Text';

function CodeInlineInParagraph() {
  return (
    <Text type="body" style={{maxWidth: 400}}>
      Use <Code>useState</Code>for local state and <Code>useEffect</Code>for
      side effects. If you need shared state across components, consider{' '}
      <Code>useContext</Code>or a state management library.
    </Text>
  );
}

export default function CodeInlineInParagraphDemo() {
  return (
    <div
      data-astryx-theme="neutral"
      data-theme="light"
      style={{colorScheme: 'light', display: 'contents'}}>
      <CodeInlineInParagraph />
    </div>
  );
}

Dependencies

More by Astryx

View all
  • Astryx Banner

    Astryx Banner

    59
  • Astryx Aspect Ratio

    Astryx Aspect Ratio

    31
  • Astryx Avatar

    Astryx Avatar

    30
  • Astryx Badge

    Astryx Badge

    29
  • Astryx Button Group

    Astryx Button Group

    27
  • Astryx Chat Composer Drawer

    Astryx Chat Composer Drawer

    20
  • Astryx Toggle Button

    Astryx Toggle Button

    17
  • Astryx Avatar Group

    Astryx Avatar Group

    9