diff --git a/ui/components/component-library/label/__snapshots__/label.test.js.snap b/ui/components/component-library/label/__snapshots__/label.test.tsx.snap
similarity index 100%
rename from ui/components/component-library/label/__snapshots__/label.test.js.snap
rename to ui/components/component-library/label/__snapshots__/label.test.tsx.snap
diff --git a/ui/components/component-library/label/index.js b/ui/components/component-library/label/index.js
deleted file mode 100644
index f28365d90..000000000
--- a/ui/components/component-library/label/index.js
+++ /dev/null
@@ -1 +0,0 @@
-export { Label } from './label';
diff --git a/ui/components/component-library/label/index.ts b/ui/components/component-library/label/index.ts
new file mode 100644
index 000000000..1a984b62c
--- /dev/null
+++ b/ui/components/component-library/label/index.ts
@@ -0,0 +1,2 @@
+export { Label } from './label';
+export type { LabelComponent, LabelProps } from './label.types';
diff --git a/ui/components/component-library/label/label.js b/ui/components/component-library/label/label.js
deleted file mode 100644
index 7eca591b2..000000000
--- a/ui/components/component-library/label/label.js
+++ /dev/null
@@ -1,44 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-import classnames from 'classnames';
-import {
- FontWeight,
- TextVariant,
- Display,
- AlignItems,
-} from '../../../helpers/constants/design-system';
-import { Text } from '..';
-
-export const Label = ({ htmlFor, className, children, ...props }) => (
-
- {children}
-
-);
-
-Label.propTypes = {
- /**
- * The content of the label
- */
- children: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
- /**
- * The id of the input associated with the label
- */
- htmlFor: PropTypes.string,
- /**
- * Additional classNames to be added to the label component
- */
- className: PropTypes.string,
-};
diff --git a/ui/components/component-library/label/label.stories.js b/ui/components/component-library/label/label.stories.tsx
similarity index 70%
rename from ui/components/component-library/label/label.stories.js
rename to ui/components/component-library/label/label.stories.tsx
index 9b6554737..d653db4a1 100644
--- a/ui/components/component-library/label/label.stories.js
+++ b/ui/components/component-library/label/label.stories.tsx
@@ -1,7 +1,8 @@
import React, { useState } from 'react';
+import { ComponentMeta, ComponentStory } from '@storybook/react';
import {
- DISPLAY,
- FLEX_DIRECTION,
+ Display,
+ FlexDirection,
AlignItems,
IconColor,
} from '../../../helpers/constants/design-system';
@@ -37,21 +38,21 @@ export default {
args: {
children: 'Label',
},
-};
+} as ComponentMeta;
-const Template = (args) => ;
+const Template: ComponentStory = (args) => ;
export const DefaultStory = Template.bind({});
DefaultStory.storyName = 'Default';
-export const Children = (args) => (
+export const Children: ComponentStory = (args) => (
-
);
-export const HtmlFor = (args) => {
+export const HtmlFor: ComponentStory = (args) => {
const [value, setValue] = useState('');
const handleOnChange = (e) => {
setValue(e.target.value);
};
return (
-
+
(
+ { htmlFor, className, children, ...props }: LabelProps,
+ ref?: PolymorphicRef,
+ ) => {
+ return (
+ )}
+ >
+ {children}
+
+ );
+ },
+);
diff --git a/ui/components/component-library/label/label.types.ts b/ui/components/component-library/label/label.types.ts
new file mode 100644
index 000000000..8f897e445
--- /dev/null
+++ b/ui/components/component-library/label/label.types.ts
@@ -0,0 +1,24 @@
+import type { PolymorphicComponentPropWithRef } from '../box';
+import type { TextStyleUtilityProps } from '../text';
+
+export interface LabelStyleUtilityProps extends TextStyleUtilityProps {
+ /**
+ * The id of the input associated with the label
+ */
+ htmlFor?: string;
+ /**
+ * Additional classNames to assign to the Label component
+ */
+ className?: string;
+ /**
+ * The content of the Label component
+ */
+ children: string | React.ReactNode;
+}
+
+export type LabelProps =
+ PolymorphicComponentPropWithRef;
+
+export type LabelComponent = (
+ props: LabelProps,
+) => React.ReactElement | null;