> ## Documentation Index
> Fetch the complete documentation index at: https://docs.makeswift.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Checkbox

> Adds a Checkbox panel in the Makeswift builder to visually edit a `boolean` prop.

<Frame type="glass" caption="A checkbox panel on a Navigation component to show the logo">
  <img src="https://mintcdn.com/makeswift/uAOxEZuAmqfTEc_N/images/checkbox-panel.png?fit=max&auto=format&n=uAOxEZuAmqfTEc_N&q=85&s=5c6407df65f157435b7fc1427c10cffb" width="1024" height="640" data-path="images/checkbox-panel.png" />
</Frame>

## Params

<ParamField query="label" type="string" default="Label">
  Text for the panel label in the Makeswift builder.
</ParamField>

<ParamField query="description" type="string">
  The description shown in the Panel of the Makeswift builder. This can be written in Markdown format.
  Added in [`v0.24.8`](https://github.com/makeswift/makeswift/releases/tag/%40makeswift%2Fruntime%400.24.8).
</ParamField>

<ParamField query="defaultValue" type="boolean">
  The value passed to your component when nothing is set in the Makeswift
  builder.
</ParamField>

## Prop type

The Checkbox control passes a `boolean` to your component. If you don't set a `defaultValue` and no value is set in the builder, your component receives `undefined`.

## Example

The following example adds a Checkbox control to the `showLogo` prop of a Navigation component.

<CodeGroup>
  ```tsx Navigation.makeswift.ts theme={null}
  import { Checkbox } from "@makeswift/runtime/controls";

  import { runtime } from "@/makeswift/runtime";

  import { Navigation } from "./Navigation";

  runtime.registerComponent(Navigation, {
    type: "navigation",
    label: "Navigation",
    props: {
      showLogo: Checkbox({
        label: "Show Logo",
        defaultValue: false,
      }),
    },
  });
  ```

  ```tsx Navigation.tsx theme={null}
  interface Props {
    showLogo: boolean;
  }

  export function Navigation({ showLogo }: Props) {
    return (
      <nav>
        {props.showLogo && <img src="/logo.png" />}
        {/* ... */}
      </nav>
    );
  }
  ```
</CodeGroup>

<Info>
  `.makeswift.ts` is a naming convention for organizing Makeswift registration
  code. [Learn
  more](/developer/reference/runtime/register-component#organizing-registration-code).
</Info>
