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

# Create a Flag Variant

> Learn how to create variants to implement different experiences for a flag.

export const HowToSchema = ({name, description, steps = []}) => {
  const schema = {
    "@context": "https://schema.org",
    "@type": "HowTo",
    name,
    description
  };
  if (steps.length > 0) {
    schema.step = steps.map((s, i) => ({
      "@type": "HowToStep",
      position: i + 1,
      name: typeof s === "string" ? s : s.name,
      text: typeof s === "string" ? s : s.text || s.name
    }));
  }
  return <script type="application/ld+json" dangerouslySetInnerHTML={{
    __html: JSON.stringify(schema)
  }} />;
};

<HowToSchema
  name="Create a Flag Variant"
  description="Learn how to create variants to implement different experiences for a flag."
  steps={[
"Go to Confidence",
"On the left sidebar, select Flags",
"Go to the flag you want to add a variant to",
"Click the add button next to Variants on the flag page",
{
  name: "Step 1: Enter variant details",
  text: "Enter a Name for the variant. Choose a descriptive name like new-design. The name can't be changed after creation. Optionally add a Description to explain what this variant represents. Optionally add an Image to help visually identify the variant. Click Next to continue.",
},
{
  name: "Step 2: Set property values",
  text: "Set the values this variant returns for each property in the flag's schema. If you leave a property empty, the SDK returns the default value specified in the client when the flag is resolved. Click Create to create the variant.",
},
]}
/>

A [variant](../flags/create-flags#variants) is a named set of values for the properties of a flag.

## Create a Variant

The variant creation dialog guides you through two steps.

<Steps>
  <Step title="Go to Confidence" />

  <Step title="On the left sidebar, select Flags" />

  <Step title="Go to the flag you want to add a variant to" />

  <Step title="Click the add button next to Variants on the flag page" />

  <Step title="Step 1: Enter variant details">
    Enter a **Name** for the variant. Choose a descriptive name like `new-design`. The name can't be changed after creation.

    Optionally add a **Description** to explain what this variant represents.

    Optionally add an **Image** to help visually identify the variant.

    Click **Next** to continue.
  </Step>

  <Step title="Step 2: Set property values">
    Set the values this variant returns for each property in the flag's schema.

    If you leave a property empty, the SDK returns the default value specified in the client when the flag is resolved.

    Click **Create** to create the variant.
  </Step>
</Steps>

<Tip>
  Use short and descriptive names, informed by the provided experience. Use
  kebab-case, like `blue` instead of `Blue`, and don't include too much
  information: use `blue` instead of `blue-button-color`. Avoid including the
  name of the flag in the variant name.
</Tip>

If a variant doesn't specify the value of a property, the SDK uses the
default value specified when a client resolves the flag.

## Related Resources

<CardGroup cols={2}>
  <Card title="Create Rules" href="/docs/how-to-guides/create-conditional-targeting-rule">
    Target users with your variants
  </Card>

  <Card title="Edit Flag Schema" href="/docs/how-to-guides/edit-flag-schema">
    Define properties for your variants
  </Card>

  <Card title="Launch an A/B Test" href="/docs/quickstarts/launch-abtest">
    Compare variants in an experiment
  </Card>

  <Card title="Create Variants API" href="/docs/api/how-to-guides/flags/create-flag-variants">
    API reference for variants
  </Card>
</CardGroup>
