# @visual-framework/vf-flag

> vf-flag component

Latest version **1.0.0** (published 2025-02-25) · Apache 2.0 license · 0 weekly downloads

## Install

```sh
npm install @visual-framework/vf-flag
pnpm add @visual-framework/vf-flag
yarn add @visual-framework/vf-flag
bun add @visual-framework/vf-flag
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2025-02-25 |
| First published | 2021-03-24 |
| Weekly downloads | 0 |
| License | Apache 2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 49.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | VF |
| Maintainers | sandykadam, ebiwebdev, khawkins98, pacope92, bhushan-ebi |
| Keywords | fractal, component |

## Links

- npm: https://www.npmjs.com/package/@visual-framework/vf-flag
- Issues: https://github.com/visual-framework/vf-core/issues
- npm.io page: https://npm.io/package/@visual-framework/vf-flag

## Recent versions

- 1.0.0 (latest) — 2025-02-25
- 1.0.0-alpha.2 — 2021-06-09
- 1.0.0-alpha.1 — 2021-03-24

## README

# The Flag Layout Component

[![npm version](https://badge.fury.io/js/%40visual-framework%2Fvf-flag.svg)](https://badge.fury.io/js/%40visual-framework%2Fvf-flag)

## About

The `vf-flag` layout component is for when you need an image, icon, or other media and text next to each other.

## Usage

The `vf-flag` should, ideally, be used as part of a component with existing components for the media item and body area.

You should use the `vf-flag` layout component when you need to display a media item (avatar, image, logo) next to or after text.

The 'Flag Object', originally created by [Harry Roberts](https://csswizardry.com/2013/05/the-flag-object/) is based on the work [Nicole Sullivan](http://www.stubbornella.org/content/2010/06/25/the-media-object-saves-hundreds-of-lines-of-code/) did in creating the 'Media Object'.

The `vf-flag` allows you to determine the vertical alignment of the media and body.

As the layout component is relatively new there are no specific guidelines for when to use or not use the variants of this layout. Simply _be consistent_.

Even though the `vf-flag` layout has a default spacing design token applied as a CSS custom property fallback it is good practice in the system to use and decalre the spacing CSS class name in your project. Also, you should define the vertical variant too.


✅ `<div class="vf-flag vf-flag--middle vf-flag--400">...</div>`

❌ `<div class="vf-flag">...</div>`

❌ `<div class="vf-flag vf-flag--400">...</div>`

❌ `<div class="vf-flag vf-flag--middle">...</div>`


| variant name | description                                                           |
| ------------ | --------------------------------------------------------------------- |
| top          | aligns the media item and body to the top of the layout               |
| middle       | aligns the media item and body to the middle of the layout            |
| bottom       | aligns the media item and body to the bottom of the layout            |
| reversed     | switches the inline spacing *                                          |
| 400          | defines the spacing between the media item and body item as `1rem`    |
| 600          | defines the spacing between the media item and body item as `1.5rem`  |
| 800          | defines the spacing between the media item and body item as `2rem`    |

<sup>*</sup> The content for this variant needs to be switched so the media item follows the body
## Install

This repository is distributed with [npm][https://www.npmjs.com/]. After [installing npm][https://www.npmjs.com/get-npm] and [yarn](https://classic.yarnpkg.com/en/docs/install), you can install `vf-flag` with this command.

```
$ yarn add --dev @visual-framework/vf-flag
```

### Sass/CSS

The style files included are written in [Sass](https://sass-lang.com/). If you're using a VF-core project, you can import it like this:

```
@import "@visual-framework/vf-flag/index.scss";
```

Make sure you import Sass requirements along with the modules. You can use a [project boilerplate](https://stable.visual-framework.dev/building/) or the [`vf-sass-starter`](https://stable.visual-framework.dev/components/vf-sass-starter/)

## Help

- [Read the Visual Framework troubleshooting](https://stable.visual-framework.dev/troubleshooting/)
- [Open a ticket](https://github.com/visual-framework/vf-core/issues)
- [Chat on Slack](https://join.slack.com/t/visual-framework/shared_invite/enQtNDAxNzY0NDg4NTY0LWFhMjEwNGY3ZTk3NWYxNWVjOWQ1ZWE4YjViZmY1YjBkMDQxMTNlNjQ0N2ZiMTQ1ZTZiMGM4NjU5Y2E0MjM3ZGQ)

---
_Source: https://npm.io/package/@visual-framework/vf-flag · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
