Astryx

Astryx Checkbox Input

Forms 1

About

CheckboxInput toggles a single on/off value. Use it for settings like "Enable notifications", terms acceptance, or opt-in choices. For multiple checkboxes in a group, use CheckboxList instead.

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

Code

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

Usage.tsx

'use client';

import {useState} from 'react';
import {CheckboxInput} from '@/components/ui/astryx-checkbox-input';
import {Stack} from '@astryxdesign/core/Layout';

function CheckboxInputBasic() {
  const [checked, setChecked] = useState<boolean | 'indeterminate'>(true);
  const [unchecked, setUnchecked] = useState<boolean | 'indeterminate'>(false);
  const [disabled, setDisabled] = useState<boolean | 'indeterminate'>(false);
  const [indeterminate, setIndeterminate] = useState<boolean | 'indeterminate'>(
    'indeterminate',
  );

  return (
    <Stack direction="vertical" gap={4}>
      <CheckboxInput
        label="Checked"
        description="This checkbox is currently on."
        value={checked}
        onChange={setChecked}
      />
      <CheckboxInput
        label="Unchecked"
        description="This checkbox is currently off."
        value={unchecked}
        onChange={setUnchecked}
      />
      <CheckboxInput
        label="Disabled"
        description="This checkbox cannot be changed."
        value={disabled}
        onChange={setDisabled}
        isDisabled
      />
      <CheckboxInput
        label="Indeterminate"
        description="This checkbox represents a partial selection."
        value={indeterminate}
        onChange={setIndeterminate}
      />
    </Stack>
  );
}

export default function CheckboxInputBasicDemo() {
  return (
    <div
      data-astryx-theme="neutral"
      data-theme="light"
      style={{colorScheme: 'light', display: 'contents'}}>
      <CheckboxInputBasic />
    </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

More in Forms

View all
  • Contact Form

    Contact Form

    29
  • Form

    Form

    6
  • Premium Auth

    Premium Auth

    607
  • Book A Demo 1

    Book A Demo 1

    95
  • Card Studio

    Card Studio

    48
  • Contact Card

    Contact Card

    1.1K
  • Login 2

    Login 2

    16
  • Paper Plane

    Paper Plane

    21