# Property Photos (/docs/components/property-photos)



<ComponentPreview name="property-photos" />

## Installation [#installation]

<Tabs items="[&#x22;Command&#x22;, &#x22;Manual&#x22;]">
  <Tab value="Command">
    <CodeBlockTabs defaultValue="npm">
      <CodeBlockTabsList>
        <CodeBlockTabsTrigger value="npm">
          npm
        </CodeBlockTabsTrigger>

        <CodeBlockTabsTrigger value="pnpm">
          pnpm
        </CodeBlockTabsTrigger>

        <CodeBlockTabsTrigger value="yarn">
          yarn
        </CodeBlockTabsTrigger>

        <CodeBlockTabsTrigger value="bun">
          bun
        </CodeBlockTabsTrigger>
      </CodeBlockTabsList>

      <CodeBlockTab value="npm">
        ```bash
        npx shadcn@latest add @uploadcn/property-photos
        ```
      </CodeBlockTab>

      <CodeBlockTab value="pnpm">
        ```bash
        pnpm dlx shadcn@latest add @uploadcn/property-photos
        ```
      </CodeBlockTab>

      <CodeBlockTab value="yarn">
        ```bash
        yarn dlx shadcn@latest add @uploadcn/property-photos
        ```
      </CodeBlockTab>

      <CodeBlockTab value="bun">
        ```bash
        bun x shadcn@latest add @uploadcn/property-photos
        ```
      </CodeBlockTab>
    </CodeBlockTabs>
  </Tab>

  <Tab value="Manual">
    Install [Upload](/docs/components/upload), then copy:

    <ComponentSource name="property-photos" />
  </Tab>
</Tabs>

## Usage [#usage]

```tsx
import { PropertyPhotos } from "@/components/property-photos"
```

```tsx
<PropertyPhotos
  rooms={[
    "Exterior",
    "Living room",
    "Kitchen",
    "Bedroom",
    "Bathroom",
    "Garden",
  ]}
  recommended={15}
  onChange={(photos) => save(photos)}
/>
```

Room tags live on each item's `meta.room` (set with `uploader.update`), and the room picker is a native `<select>` so it works everywhere, including screen readers.

## Props [#props]

<TypeTable
  type="{
  adapter: {
    type: &#x22;UploadAdapter&#x22;,
    default: 's3Adapter({ endpoint: &#x22;/api/upload&#x22; })',
    description: &#x22;Where files go.&#x22;,
  },
  uploader: {
    type: &#x22;Uploader&#x22;,
    description: &#x22;An uploader from `useUploader`, instead of options.&#x22;,
  },
  rooms: { type: &#x22;string[]&#x22; },
  requiredRooms: { type: &#x22;string[]&#x22;, default: 'all but &#x22;Other&#x22;' },
  recommended: { type: &#x22;number&#x22;, default: &#x22;12&#x22; },
  maxFiles: { type: &#x22;number&#x22;, default: &#x22;40&#x22; },
  onChange: { type: &#x22;(photos: { item, room }[]) => void&#x22; },
  className: { type: &#x22;string&#x22; },
}"
/>
