# Brand Image

> A responsive picture with focal point and loading priority.

```tsx
import { BrandImage } from '@brand-studio/ui';
import { cup } from '@/demos/assets';

export default function BrandImageDemo() {
  return (
    <div style={{ width: '100%', maxWidth: 560, aspectRatio: '3 / 2', borderRadius: 'var(--bs-radius)', overflow: 'hidden' }}>
      <BrandImage asset={cup} sizes="(min-width: 768px) 560px, 100vw" />
    </div>
  );
}
```

## Installation

```sh
npm install @brand-studio/ui
```

React 18 or 19 is a peer dependency. Import the stylesheet once and wrap the app in a brand theme:

```tsx
import '@brand-studio/ui/styles.css';
import { BrandTheme, BrandImage } from '@brand-studio/ui';
import brand from './brand.json';

<BrandTheme palette={brand.tokens} mode="system">
  {/* your app */}
</BrandTheme>
```

## Usage

```tsx
import { BrandImage } from '@brand-studio/ui';
```

```tsx
<BrandImage asset={cup} sizes="(min-width: 768px) 50vw, 100vw" />
```

## Accessibility

- `priority` loads the image eagerly with high fetch priority; use it for the first image on a page.
- `focalPoint` keeps the subject in frame when the image is cropped.

## API Reference

| Prop | Type | Default |
|---|---|---|
| `asset` | `ImageAsset` | – |
| `priority?` | `boolean` | `false` |
| `className?` | `string` | `''` |
| `sizes?` | `string` | `'100vw'` |

Source: https://brandstudio.js.org/docs/components/brand-image/
