gridland
API Reference

@gridland/ui

UI component library API reference

Individual components can be installed via the shadcn CLI. See the Installing Components guide for details.

bunx shadcn@latest add @gridland/<component-name>

Gradient

Renders color gradients across text or backgrounds.

import { Gradient } from "@/components/ui/gradient"

See Gradient component docs for usage examples.

Props

PropTypeDefaultDescription
colorsstring[]requiredHex color stops
direction"horizontal" | "vertical""horizontal"Gradient direction
mode"foreground" | "background""foreground"Where to apply colors
childrenReactNoderequiredContent to render

interpolateColor(color1, color2, t)

Interpolate between two hex colors.

  • color1 - Start color (hex string)
  • color2 - End color (hex string)
  • t - Interpolation factor (0 to 1)
  • Returns: Hex color string

generateGradient(colors, steps)

Generate an array of interpolated colors.

  • colors - Array of hex color stops
  • steps - Number of output colors
  • Returns: Array of hex color strings

Table

Renders structured data in a table layout.

import { Table } from "@/components/ui/table"

See Table component docs for usage examples.

Props

PropTypeDefaultDescription
columnsColumn[]requiredColumn definitions
dataRecord<string, any>[]requiredRow data
borderStylestring"single"Table border style
headerColorstring"#ffffff"Header text color

Column

PropertyTypeDefaultDescription
headerstringrequiredDisplay header
keystringrequiredData key
widthnumberautoColumn width
align"left" | "center" | "right""left"Alignment
colorstringinheritedCell text color