{
  "name": "utilities/flank",
  "title": "Flank",
  "description": "Use the `ed-flank` class to position two items side-by-side, with one item positioned alongside, or _flanking_, content that stretches to fill the available space.",
  "docs": "https://test-apps.eurodata.de/a/eurodata-ui/docs/utilities/flank/",
  "sections": [
    {
      "heading": "Flank",
      "markdown": "Use the `ed-flank` class to position two items side-by-side, with one item positioned alongside, or _flanking_, content that stretches to fill the available space. When space is limited, the items wrap.\n\n```html\n<div class=\"ed-flank\">\n  <div></div>\n  <div></div>\n</div>\n```"
    },
    {
      "heading": "Examples",
      "markdown": "Flanks work especially well for asides, inputs with adjacent buttons, and rich description lists.\n\n```html\n<div class=\"ed-flank:end ed-gap-2\">\n  <ed-input>\n    <ed-icon slot=\"start\" name=\"search\"></ed-icon>\n  </ed-input>\n  <ed-button>Search</ed-button>\n</div>\n```\n\n```html\n<div class=\"ed-stack ed-gap-6\">\n  <div class=\"ed-flank ed-align-items-start\">\n    <ed-avatar\n      image=\"https://images.unsplash.com/photo-1553284966-19b8815c7817?q=20\"\n      label=\"Gandalf's avatar\"\n    ></ed-avatar>\n    <div class=\"ed-stack ed-gap-1\">\n      <strong>Gandalf</strong>\n      <p class=\"ed-body-s\">\n        All we have to decide is what to do with the time that is given to us. There are other forces at work in this\n        world, Frodo, besides the will of evil.\n      </p>\n    </div>\n  </div>\n  <div class=\"ed-flank ed-align-items-start\">\n    <ed-avatar\n      image=\"https://images.unsplash.com/photo-1542403764-c26462c4697e?q=20\"\n      label=\"Boromir's avatar\"\n    ></ed-avatar>\n    <div class=\"ed-stack ed-gap-1\">\n      <strong>Boromir</strong>\n      <p class=\"ed-body-s\">\n        One does not simply walk into Mordor. Its Black Gates are guarded by more than just Orcs. There is evil there\n        that does not sleep, and the Great Eye is ever watchful.\n      </p>\n    </div>\n  </div>\n  <div class=\"ed-flank ed-align-items-start\">\n    <ed-avatar\n      image=\"https://images.unsplash.com/photo-1518495973542-4542c06a5843?q=20\"\n      label=\"Galadriel's avatar\"\n    ></ed-avatar>\n    <div class=\"ed-stack ed-gap-1\">\n      <strong>Galadriel</strong>\n      <p class=\"ed-body-s\">\n        The world is changed. I feel it in the water. I feel it in the earth. I smell it in the air. Much that once was\n        is lost, for none now live who remember it.\n      </p>\n    </div>\n  </div>\n</div>\n```"
    },
    {
      "heading": "Position",
      "markdown": "By default, the first item in the `ed-flank` container will flank the other content. You can specify whether the first or last item will flank the remaining content by appending `:start` or `:end` to the `ed-flank` class.\n\n```html\n<div class=\"ed-stack\">\n  <div class=\"ed-flank:start\">\n    <div></div>\n    <div></div>\n  </div>\n  <div class=\"ed-flank:end\">\n    <div></div>\n    <div></div>\n  </div>\n</div>\n```"
    },
    {
      "heading": "Sizing",
      "markdown": "The flank's inline size is determined by the size of its content, but you can set a target size using the `--ed-flank-size` property. When the flank wraps, it stretches to fill the inline size of the container.\n\n```html\n<div class=\"ed-stack\">\n  <div class=\"ed-flank\" style=\"--ed-flank-size: 200px;\">\n    <div></div>\n    <div></div>\n  </div>\n  <div class=\"ed-flank\" style=\"--ed-flank-size: 6rem;\">\n    <div></div>\n    <div></div>\n  </div>\n</div>\n```\n\nThe main content fills the remaining inline space of the container. By default, the items wrap when the main content is less than 50% of the container. You can change the minimum size of the main content with the `--ed-flank-content-percentage` property.\n\n```html\n<div class=\"ed-stack\">\n  <div class=\"ed-flank\" style=\"--ed-flank-content-percentage: 70%;\">\n    <div></div>\n    <div></div>\n  </div>\n  <div class=\"ed-flank\" style=\"--ed-flank-content-percentage: 80%;\">\n    <div></div>\n    <div></div>\n  </div>\n</div>\n```"
    },
    {
      "heading": "Align Items",
      "markdown": "By default, items are centered in the block direction of the `ed-flank` container. You can add any of the following [`ed-align-items-*`](https://test-apps.eurodata.de/a/eurodata-ui/docs/utilities/align-items) classes to an element with `ed-flank` to specify how items are aligned in the block direction:\n\n-   `ed-align-items-start`\n-   `ed-align-items-end`\n-   `ed-align-items-center`\n-   `ed-align-items-stretch`\n-   `ed-align-items-baseline`\n\n```html\n<div class=\"ed-stack\">\n  <div class=\"ed-flank ed-align-items-start\" style=\"min-height: 8rem;\">\n    <div></div>\n    <div></div>\n  </div>\n  <div class=\"ed-flank ed-align-items-end\" style=\"min-height: 8rem;\">\n    <div></div>\n    <div></div>\n  </div>\n  <div class=\"ed-flank ed-align-items-center\" style=\"min-height: 8rem;\">\n    <div></div>\n    <div></div>\n  </div>\n  <div class=\"ed-flank ed-align-items-stretch\" style=\"min-height: 8rem;\">\n    <div></div>\n    <div></div>\n  </div>\n</div>\n```"
    },
    {
      "heading": "Gap",
      "markdown": "By default, the gap between flank items uses `--ed-space-4` from your theme. Add any [`ed-gap-N`](https://test-apps.eurodata.de/a/eurodata-ui/docs/utilities/gap) class (N from 0 to 16) to an element with `ed-flank` to specify the gap between items.\n\n```html\n<div class=\"ed-stack\">\n  <div class=\"ed-flank ed-gap-1\">\n    <div></div>\n    <div></div>\n  </div>\n  <div class=\"ed-flank ed-gap-8\">\n    <div></div>\n    <div></div>\n  </div>\n</div>\n```"
    }
  ]
}
