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

# Passing Props to Custom Components

> Useful for custom components that are reused in different stores/versions where each requires a different configuration

Ollie Custom Components can receive properties configured directly in the Admin.

<Frame>
  <img src="https://mintcdn.com/ollie/p4g51XgUf4XQQQQK/images/prop-configuration.png?fit=max&auto=format&n=p4g51XgUf4XQQQQK&q=85&s=1845ab63cca8250532f382d920dc0a0e" alt="Prop Configuration Pn" width="2512" height="1652" data-path="images/prop-configuration.png" />
</Frame>

This is useful when you have a custom component but would like to abe able to change some of it's behaviour without needing to make code changes.

## Example - Free Shipping Progress Bar

Instead of hard-coding the Free Shipping Tier directly in the code, use props to define the component behavior.

In this example the Free Shipping custom component has a default value of \$99.00 and let's assume that we need to change the Free Tier to \$350.00.

<Frame>
  <img src="https://mintcdn.com/ollie/p4g51XgUf4XQQQQK/images/free-shipping-custom-component.png?fit=max&auto=format&n=p4g51XgUf4XQQQQK&q=85&s=b0d311a9bc7f0c27c69ced03185782f1" alt="Free Shipping Custom Component Pn" width="1420" height="1182" data-path="images/free-shipping-custom-component.png" />
</Frame>

In the custom component code you can define a variable and via the admin you can assign a value that will override the hard-coded value in your code.

The snippet below is part of a Free Shipping Progress Bar (custom) component. The developer declared a variable named `target` and assgined a value of `99`, however it also declared that this component can receive props.

```typescript index.tsx theme={"system"}
// piece of component with the target prop
const FreeShippingProgress: React.FC<FreeShippingProgressProps> = ({
   target = 99,
  ...props
}) => {
```

When you configure props in the admin, you can name them and if there is a matching variable then the configured value will override the hard-coded one.

<Frame>
  <img src="https://mintcdn.com/ollie/p4g51XgUf4XQQQQK/images/free-shipping-tier-350.png?fit=max&auto=format&n=p4g51XgUf4XQQQQK&q=85&s=e3bf14cde00594b8546026bb21d8ac9d" alt="Free Shipping Tier 350 Pn" width="2528" height="1650" data-path="images/free-shipping-tier-350.png" />
</Frame>

The result is the component will now use the configured prop `target=350` instead of the original (default) value of 99.

<Frame>
  <img src="https://mintcdn.com/ollie/p4g51XgUf4XQQQQK/images/free-shipping-tier-350-front.png?fit=max&auto=format&n=p4g51XgUf4XQQQQK&q=85&s=d7c89b22fc4f9ec26d4652b864afb2ef" alt="Free Shipping Tier 350 Front Pn" width="1338" height="438" data-path="images/free-shipping-tier-350-front.png" />
</Frame>
