> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://developers.webflow.com/code-components/reference/prop-types/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.webflow.com/_mcp/server. # Prop Types > Learn about the different prop types available for code components. Prop types define the configurable properties that designers can edit in the Webflow designer. When you create a code component, you specify which React component properties to expose to designers, and how they should appear in Webflow. ## Defining props in your code component In your `declareComponent` function, include a `props` property that maps your React component's properties to Webflow prop types. This tells Webflow: * Which properties designers can configure. * How each property should appear in the designer * Which values are valid for each property * Default values for each property (for certain prop types) ## Basic usage ```tsx title={"Button.webflow.tsx"} import {Button} from './Button'; import { props } from '@webflow/data-types'; import { declareComponent } from '@webflow/react'; export default declareComponent(Button, { name: 'Button', description: 'A button component', group: 'Interaction', props: { // Expose the 'text' prop as a text field text: props.Text({ name: 'Button text', defaultValue: 'Hello World!', }), // Expose the 'variant' prop as a dropdown named 'Style' variant: props.Variant({ name: 'Style', options: ['primary', 'secondary'], }), }, }); ``` ## Available prop types Choose the appropriate prop type based on what you want designers to configure: ### Text and content * **[Text](/code-components/reference/prop-types/text)** - Single line text input * **[Rich Text](/code-components/reference/prop-types/rich-text)** - Multi-line text with formatting * **[Text Node](/code-components/reference/prop-types/text-node)** - Single and Multi-line text that designers can edit on the canvas * **[Link](/code-components/reference/prop-types/link)** - URL input with validation ### Assets and data * **[Image](/code-components/reference/prop-types/image)** - Image upload and selection * **[Number](/code-components/reference/prop-types/number)** - Numeric input with validation * **[Boolean](/code-components/reference/prop-types/boolean)** - True/false toggle ### Structure and styles * **[Variant](/code-components/reference/prop-types/variant)** - Dropdown with predefined options * **[Visibility](/code-components/reference/prop-types/visibility)** - Show/hide controls * **[Slot](/code-components/reference/prop-types/slot)** - Content areas for other components * **[ID](/code-components/reference/prop-types/id)** - HTML Element ID ## Prop values Each prop type returns a value to your React component. For example, `props.Text` returns a string, while `props.Link()` returns an object with `href` and `target` properties. Most times, you can map the prop values directly. For example, if your React component expects `text` as a string, you can map it to a `props.Text` prop. However, if your React component expects specific properties from the returned object, you need to create a wrapper component that transforms the data. For example, the `props.Link()` prop type returns the following object: **`Link prop value`** ```tsx title="Link prop value" { href: string; target?: "_self" | "_blank" | string; preload?: "prerender" | "prefetch" | "none" | string; } ``` If your React component expects `href` and `target` separately, you need to create a wrapper component that transforms the data: ```tsx title={"Button.webflow.tsx"} import { props, PropType, PropValues } from "@webflow/data-types"; import { declareComponent } from "@webflow/react"; import React from "react"; import Button, { ButtonProps } from "./Button"; // Remove href and target from the props to prevent conflicts type WebflowButtonProps = { link: PropValues[PropType.Link]; } & Omit; // Remove buttonText from the props // Wrapper that destructures the object returned from `props.Link` and passes the href and target to the button component as expected. const WebflowButton = ({ link: { href, target }, ...props }: WebflowButtonProps) => { return (