components/GridItem.tsx

polar · clients/packages/orbit/src/components/GridItem.tsx · typescript · Apache-2.0
ui

A layout component that positions children within a CSS grid using responsive span and placement properties.

// Source: https://github.com/polarsource/polar | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
'use client'

import * as React from 'react'
import type { GridLine } from '../utils/grid'
import type { ResponsiveValue } from '../utils/types'
import { Box, type BoxProps } from './Box'

// These grid-placement props are re-exposed under shorter names below.
type OmittedGridItemProps =
  | 'gridArea'
  | 'gridColumn'
  | 'gridRow'
  | 'gridColumnStart'
  | 'gridColumnEnd'
  | 'gridRowStart'
  | 'gridRowEnd'

// A span count: how many tracks to cover.
type Span = ResponsiveValue<number | 'auto'>
// A single placement line: a line number, `auto`, or `span N`.
type Line = ResponsiveValue

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key