diff --git a/src/components/Checkbox.astro b/src/components/Checkbox.astro new file mode 100644 index 000000000000000..5fcaa2441b4b775 --- /dev/null +++ b/src/components/Checkbox.astro @@ -0,0 +1,66 @@ +--- +import { z } from "astro:schema"; + +const props = z.object({ + label: z.string(), +}); + +const { label } = props.parse(Astro.props); +--- + + + + + + diff --git a/src/components/index.ts b/src/components/index.ts index ce408887cbbcf14..dbbe707fd2ff318 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -7,6 +7,7 @@ export { Icon as AstroIcon } from "astro-icon/components"; export { default as AnchorHeading } from "./AnchorHeading.astro"; export { default as APIRequest } from "./APIRequest.astro"; export { default as AvailableNotifications } from "./AvailableNotifications.astro"; +export { default as Checkbox } from "./Checkbox.astro"; export { default as CompatibilityFlag } from "./CompatibilityFlag.astro"; export { default as CompatibilityFlags } from "./CompatibilityFlags.astro"; export { default as ComponentUsage } from "./ComponentUsage.astro"; diff --git a/src/content/docs/style-guide/components/checkbox.mdx b/src/content/docs/style-guide/components/checkbox.mdx new file mode 100644 index 000000000000000..9c34300d19a3f98 --- /dev/null +++ b/src/content/docs/style-guide/components/checkbox.mdx @@ -0,0 +1,23 @@ +--- +title: Checkbox +styleGuide: + component: Checkbox +--- + +import { Type, MetaInfo } from "~/components"; + +The `Checkbox` component is a custom checkbox that persists its state in local storage. + +```mdx live +import { Checkbox } from "~/components"; + + + + +``` + +## Props + +- `label` + + The label for the checkbox.