docs/components/layout/MediaGrid

MediaGrid

Responsive media card grid.

import { MediaGrid } from '@ybouhjira/hyperkit';

Static examples

This component depends on app-level context (providers, services, or interactive setup) that does not fit the inline playground yet, so its examples are shown as static code.

#Props

PropTypeDefaultDescription
items *MediaGridItem[]Array of media items to display.
selectedIdstring | nullID of the currently selected item.
onAdd(files: File[]) => voidCallback when "+" card is clicked or files are dropped on the grid.
onSelect(id: string) => voidCallback when an item is clicked.
onDelete(id: string) => voidCallback when an item's delete button is clicked.
onReplace(id: string, file: File) => voidCallback when a file is dropped onto an existing item.
acceptstring'image/*'Accepted MIME types or file extensions.
maxSizenumberMaximum file size in bytes.
columnMinWidthnumber100Minimum column width in pixels for responsive grid.
showLabelsbooleantrueShow labels below items.
addLabelstring'Add'Label text for the add button.
disabledbooleanfalseDisable all interactions.
classstringAdditional CSS classes.
styleJSX.CSSPropertiesCustom styles.

* required prop.

#Design Tokens

This component reads the following CSS custom properties. Override them globally or per-instance to restyle it — see the CSS Variables guide.

  • --sk-accent
  • --sk-accent-subtle
  • --sk-bg-secondary
  • --sk-bg-tertiary
  • --sk-border
  • --sk-font-size-xs
  • --sk-media-grid-bg
  • --sk-media-grid-border
  • --sk-media-grid-column-min
  • --sk-media-grid-radius
  • --sk-radius-md
  • --sk-space-sm
  • --sk-space-xs
  • --sk-text-muted
  • --sk-text-secondary